awinml commited on
Commit
2c6880c
1 Parent(s): 94ee7f8

Upload 2 files

Browse files
Files changed (2) hide show
  1. app.py +3 -7
  2. utils.py +2 -2
app.py CHANGED
@@ -260,13 +260,9 @@ elif decoder_model == "FLAN-T5":
260
  if submitted:
261
  for context_text in context_list:
262
  output_text.append(
263
- flan_t5_pipeline(
264
- "Question:"
265
- + query_text
266
- + "\nContext:"
267
- + context_text
268
- + "\nAnswer?"
269
- )[0]["summary_text"]
270
  )
271
  st.subheader("Answer:")
272
  for text in output_text:
 
260
  if submitted:
261
  for context_text in context_list:
262
  output_text.append(
263
+ flan_t5_pipeline("Summarize:" + context_text)[0][
264
+ "summary_text"
265
+ ]
 
 
 
 
266
  )
267
  st.subheader("Answer:")
268
  for text in output_text:
utils.py CHANGED
@@ -44,8 +44,8 @@ def get_t5_model():
44
  def get_flan_t5_model():
45
  return pipeline(
46
  "summarization",
47
- model="google/flan-t5-large",
48
- tokenizer="google/flan-t5-large",
49
  max_length=512,
50
  # length_penalty = 0
51
  )
 
44
  def get_flan_t5_model():
45
  return pipeline(
46
  "summarization",
47
+ model="google/flan-t5-base",
48
+ tokenizer="google/flan-t5-base",
49
  max_length=512,
50
  # length_penalty = 0
51
  )