Spaces:
Sleeping
Sleeping
Update nlp.py
Browse files
nlp.py
CHANGED
@@ -38,7 +38,7 @@ def summarize_text(text, max_length=100):
|
|
38 |
if response.status_code != 200:
|
39 |
return StreamlitException(f"**Error**: {response.status_code}")
|
40 |
try:
|
41 |
-
summary = response.json()[0]["
|
42 |
except (KeyError, IndexError):
|
43 |
return StreamlitException("**Error**: Invalid response from API.")
|
44 |
return summary
|
|
|
38 |
if response.status_code != 200:
|
39 |
return StreamlitException(f"**Error**: {response.status_code}")
|
40 |
try:
|
41 |
+
summary = response.json()[0]["generated_text"]
|
42 |
except (KeyError, IndexError):
|
43 |
return StreamlitException("**Error**: Invalid response from API.")
|
44 |
return summary
|