Spaces:
Build error
Build error
Upload 2 files
Browse files
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 |
-
"
|
| 265 |
-
|
| 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-
|
| 48 |
-
tokenizer="google/flan-t5-
|
| 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 |
)
|