Spaces:
Runtime error
Runtime error
Commit
·
af1fb7b
1
Parent(s):
bc069c0
Update app.py
Browse files
app.py
CHANGED
@@ -21,8 +21,10 @@ from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline
|
|
21 |
|
22 |
@st.cache(allow_output_mutation=True)
|
23 |
def load_model():
|
24 |
-
model =
|
25 |
-
|
|
|
|
|
26 |
|
27 |
# model = model.to(device)
|
28 |
|
@@ -93,5 +95,4 @@ JOB#: Job Number 20340"""
|
|
93 |
input_text = st.text_area("Notes:", prompt)
|
94 |
if st.button('Summarize'):
|
95 |
final_input = f"""[Notes]:\n{input_text}\n[Summary]:\n"""
|
96 |
-
st.write(summarize_function(final_input))
|
97 |
-
|
|
|
21 |
|
22 |
@st.cache(allow_output_mutation=True)
|
23 |
def load_model():
|
24 |
+
model = AutoModelForCausalLM.from_pretrained("bryanmildort/gpt_neo_notes", low_cpu_mem_usage=True)
|
25 |
+
tokenizer = AutoTokenizer.from_pretrained("bryanmildort/gpt_neo_notes")
|
26 |
+
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
|
27 |
+
return pipe
|
28 |
|
29 |
# model = model.to(device)
|
30 |
|
|
|
95 |
input_text = st.text_area("Notes:", prompt)
|
96 |
if st.button('Summarize'):
|
97 |
final_input = f"""[Notes]:\n{input_text}\n[Summary]:\n"""
|
98 |
+
st.write(summarize_function(final_input))
|
|