bryanmildort commited on
Commit
2537ff0
·
1 Parent(s): 680b3f7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -18,8 +18,6 @@ import torch
18
  device = "cuda:0" if torch.cuda.is_available() else "cpu"
19
  device_str = f"""Device being used: {device}"""
20
  st.write(device_str)
21
- device_map = infer_auto_device_map(model, dtype="float16")
22
- st.write(device_map)
23
 
24
  # model = AutoModelForCausalLM.from_pretrained("bryanmildort/gpt-clinical-notes-summarizer", load_in_8bit=True, device_map="auto")
25
  # model = model.to(device)
@@ -28,6 +26,9 @@ tokenizer = AutoTokenizer.from_pretrained("bryanmildort/gpt-clinical-notes-summa
28
  checkpoint = "bryanmildort/gpt-notes-summarizer-demo"
29
  model = AutoModelForCausalLM.from_pretrained(checkpoint, device_map="auto", offload_folder="offload", offload_state_dict = True, no_split_module_classes=["GPTJBlock"], torch_dtype=torch.float16)
30
 
 
 
 
31
  prompt = """Edie Whelan is a 26 yo female who is here for follow-up following an ED visit for palpitations 2 weeks ago. She had a normal workup in the ED consisting of CBC, metabolic panel, cardiac enzymes and and ECG. She states that she has a 5 yr hx of palpitations with SOB, throat tightening, nause and clamminess. these have been increasing in frequency in the past few weeks to 1-2x a day until 2 weeks ago when she had associated numbness in her fingers. She states that there are no precipitating events and these stop on their own. She endorses recent life stressors having bought a condo 3 months ago and lost her job 2 months ago. She denies fevers, chills, changes in skin/hair/nails or chest pain/tightness. She denies vision or hearing changes.
32
  PMH: none, Meds: none, Allergies: none, Surgeries: None, Family hx: none
33
  Social: denies caffeine, tobacco, alcohol, and drug use. Is in a monogomous relationship and has sex with condoms"""
 
18
  device = "cuda:0" if torch.cuda.is_available() else "cpu"
19
  device_str = f"""Device being used: {device}"""
20
  st.write(device_str)
 
 
21
 
22
  # model = AutoModelForCausalLM.from_pretrained("bryanmildort/gpt-clinical-notes-summarizer", load_in_8bit=True, device_map="auto")
23
  # model = model.to(device)
 
26
  checkpoint = "bryanmildort/gpt-notes-summarizer-demo"
27
  model = AutoModelForCausalLM.from_pretrained(checkpoint, device_map="auto", offload_folder="offload", offload_state_dict = True, no_split_module_classes=["GPTJBlock"], torch_dtype=torch.float16)
28
 
29
+ device_map = infer_auto_device_map(model, dtype="float16")
30
+ st.write(device_map)
31
+
32
  prompt = """Edie Whelan is a 26 yo female who is here for follow-up following an ED visit for palpitations 2 weeks ago. She had a normal workup in the ED consisting of CBC, metabolic panel, cardiac enzymes and and ECG. She states that she has a 5 yr hx of palpitations with SOB, throat tightening, nause and clamminess. these have been increasing in frequency in the past few weeks to 1-2x a day until 2 weeks ago when she had associated numbness in her fingers. She states that there are no precipitating events and these stop on their own. She endorses recent life stressors having bought a condo 3 months ago and lost her job 2 months ago. She denies fevers, chills, changes in skin/hair/nails or chest pain/tightness. She denies vision or hearing changes.
33
  PMH: none, Meds: none, Allergies: none, Surgeries: None, Family hx: none
34
  Social: denies caffeine, tobacco, alcohol, and drug use. Is in a monogomous relationship and has sex with condoms"""