Commit
·
52e16a3
1
Parent(s):
9f17e69
changed json load
Browse files
app.py
CHANGED
|
@@ -132,7 +132,8 @@ cohere_model = CohereLLM()
|
|
| 132 |
#HfApiModel("mistralai/Mistral-7B-v0.1-chat")
|
| 133 |
|
| 134 |
def mainFunc(articles):
|
| 135 |
-
|
|
|
|
| 136 |
newsApiKey = os.getenv('NEWSAPI_KEY')
|
| 137 |
if not newsApiKey:
|
| 138 |
raise ValueError("Missing NEWS_API_KEY in environment variables.")
|
|
|
|
| 132 |
#HfApiModel("mistralai/Mistral-7B-v0.1-chat")
|
| 133 |
|
| 134 |
def mainFunc(articles):
|
| 135 |
+
if isinstance(articles, str):
|
| 136 |
+
articles = json.loads(articles)
|
| 137 |
newsApiKey = os.getenv('NEWSAPI_KEY')
|
| 138 |
if not newsApiKey:
|
| 139 |
raise ValueError("Missing NEWS_API_KEY in environment variables.")
|