Spaces:
Runtime error
Runtime error
Update pages/summarizer.py
Browse files- pages/summarizer.py +1 -1
pages/summarizer.py
CHANGED
|
@@ -41,7 +41,7 @@ def main():
|
|
| 41 |
response = query_huggingface(payload)
|
| 42 |
|
| 43 |
# Extract summary text from the API response
|
| 44 |
-
summary_text = response.get("summary_text", "")
|
| 45 |
|
| 46 |
# Add summarization response to chat history
|
| 47 |
chat_history.append({"speaker": "Bot", "message": summary_text})
|
|
|
|
| 41 |
response = query_huggingface(payload)
|
| 42 |
|
| 43 |
# Extract summary text from the API response
|
| 44 |
+
summary_text = response[0]["summary_text"] if isinstance(response, list) else response.get("summary_text", "")
|
| 45 |
|
| 46 |
# Add summarization response to chat history
|
| 47 |
chat_history.append({"speaker": "Bot", "message": summary_text})
|