tmberooney commited on
Commit
2e856b1
·
1 Parent(s): 94fb59c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -18,12 +18,11 @@ secret_key = os.getenv("HUGGINGFACE_ACCESS_TOKEN")
18
 
19
  from torch import nn
20
 
21
- from peft import PeftModel, PeftConfig
22
- from transformers import AutoModelForCausalLM, AutoTokenizer
23
 
24
- config = PeftConfig.from_pretrained("tmberooney/medllama")
25
- model = AutoModelForCausalLM.from_pretrained("daryl149/llama-2-7b-chat-hf", use_auth_token=secret_key, llm_int8_enable_fp32_cpu_offload=True, torch_dtype=torch.float16)
26
- model = PeftModel.from_pretrained(model, "tmberooney/medllama", use_auth_token=secret_key)
27
  device_map = {"transformer.word_embeddings": "cpu",
28
  "transformer.word_embeddings_layernorm": "cpu",
29
  "lm_head": "cpu",
@@ -54,7 +53,7 @@ llama_pipeline = pipeline(
54
  )
55
 
56
  SYSTEM_PROMPT = """<s>[INST] <<SYS>>
57
- You are a helpful medical bot. Your answers are clear and concise with medical information.
58
  <</SYS>>
59
 
60
  """
 
18
 
19
  from torch import nn
20
 
21
+ # Load model directly
22
+ from transformers import AutoTokenizer, AutoModelForCausalLM
23
 
24
+ tokenizer = AutoTokenizer.from_pretrained("tmberooney/medllama-merged")
25
+ model = AutoModelForCausalLM.from_pretrained("tmberooney/medllama-merged")
 
26
  device_map = {"transformer.word_embeddings": "cpu",
27
  "transformer.word_embeddings_layernorm": "cpu",
28
  "lm_head": "cpu",
 
53
  )
54
 
55
  SYSTEM_PROMPT = """<s>[INST] <<SYS>>
56
+ ou are a Doctor, Who is trained to listen to patients claims about what they have been feeling. You are to notice their sypmtoms, the medications they have been taking and their medical history. Based on this You have made a appropriate Diagnosis.
57
  <</SYS>>
58
 
59
  """