Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -737,7 +737,7 @@ def rag_summarize(texts, summarizer, top_k=5):
|
|
| 737 |
top_indices = scores.argsort()[::-1][:top_k]
|
| 738 |
ctx = "\n".join(texts[i] for i in top_indices)
|
| 739 |
prompt = "summarize: " + ctx[:1024]
|
| 740 |
-
out = summarizer(prompt, max_length=
|
| 741 |
return out[0]['summary_text']
|
| 742 |
|
| 743 |
def extract_month_year(q):
|
|
|
|
| 737 |
top_indices = scores.argsort()[::-1][:top_k]
|
| 738 |
ctx = "\n".join(texts[i] for i in top_indices)
|
| 739 |
prompt = "summarize: " + ctx[:1024]
|
| 740 |
+
out = summarizer(prompt, max_length=250, min_length=80, do_sample=False)
|
| 741 |
return out[0]['summary_text']
|
| 742 |
|
| 743 |
def extract_month_year(q):
|