bryanmildort commited on
Commit
34a9b5d
·
1 Parent(s): 869682c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -7
app.py CHANGED
@@ -11,18 +11,21 @@ def summarize_function(notes):
11
  st.write('Summary: ')
12
  return gen_text
13
 
14
- notes_df = pd.read_csv('notes_small.csv')
15
- examples_tuple = ()
16
- for i in range(len(notes_df)):
17
- examples_tuple += (f"Patient {i+1}", )
 
 
 
18
 
19
- example = st.sidebar.selectbox('Example', (examples_tuple), index=0)
20
 
21
  st.markdown("<h1 style='text-align: center; color: #489DDB;'>GPT Clinical Notes Summarizer</h1>", unsafe_allow_html=True)
22
  st.markdown("<h6 style='text-align: center; color: #489DDB;'>by Bryan Mildort</h1>", unsafe_allow_html=True)
23
 
24
  st.sidebar.markdown("<h1 style='text-align: center; color: #489DDB;'>GPT Clinical Notes Summarizer 0.1v</h1>", unsafe_allow_html=True)
25
- st.sidebar.markdown("<h6 style='text-align: center; color: #489DDB;'>The model for this application was created with generous support of the Google TPU Research Cloud (TPU). This demo is for investigative research purposes only. The model is assumed to have several limiations and biases, so please oversee responses with human moderation. It is not intended for production ready enterprises and is displayed to illustrate the capabilities of Large Language Models for healthcare research.</h1>", unsafe_allow_html=True)
26
  tower = Image.open('howard_social.png')
27
  seal = Image.open('Howard_University_seal.svg.png')
28
  st.sidebar.image(tower)
@@ -36,7 +39,7 @@ from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline
36
  # device_map = infer_auto_device_map(model, dtype="float16")
37
  # st.write(device_map)
38
 
39
- # @st.cache(allow_output_mutation=True)
40
  def load_model():
41
  model = AutoModelForCausalLM.from_pretrained("bryanmildort/gpt_neo_notes", low_cpu_mem_usage=True)
42
  # model = model.to(device)
 
11
  st.write('Summary: ')
12
  return gen_text
13
 
14
+ @st.cache
15
+ def notes_select():
16
+ notes_df = pd.read_csv('notes_small.csv')
17
+ examples_tuple = ()
18
+ for i in range(len(notes_df)):
19
+ examples_tuple += (f"Patient {i+1}", )
20
+ return st.sidebar.selectbox('Example', (examples_tuple), index=0)
21
 
22
+ example = notes_select()
23
 
24
  st.markdown("<h1 style='text-align: center; color: #489DDB;'>GPT Clinical Notes Summarizer</h1>", unsafe_allow_html=True)
25
  st.markdown("<h6 style='text-align: center; color: #489DDB;'>by Bryan Mildort</h1>", unsafe_allow_html=True)
26
 
27
  st.sidebar.markdown("<h1 style='text-align: center; color: #489DDB;'>GPT Clinical Notes Summarizer 0.1v</h1>", unsafe_allow_html=True)
28
+ st.sidebar.markdown("<h6 style='text-align: center; color: #489DDB;'>The model for this application was created with generous support of the Google TPU Research Cloud (TRC). This demo is for investigative research purposes only. The model is assumed to have several limiations and biases, so please oversee responses with human moderation. It is not intended for production ready enterprises and is displayed to illustrate the capabilities of Large Language Models for healthcare research.</h1>", unsafe_allow_html=True)
29
  tower = Image.open('howard_social.png')
30
  seal = Image.open('Howard_University_seal.svg.png')
31
  st.sidebar.image(tower)
 
39
  # device_map = infer_auto_device_map(model, dtype="float16")
40
  # st.write(device_map)
41
 
42
+ @st.cache(allow_output_mutation=True)
43
  def load_model():
44
  model = AutoModelForCausalLM.from_pretrained("bryanmildort/gpt_neo_notes", low_cpu_mem_usage=True)
45
  # model = model.to(device)