Spaces:
Sleeping
Sleeping
phucpx
commited on
Commit
·
a77b866
1
Parent(s):
84d8aab
Add application file
Browse files
app.py
CHANGED
|
@@ -73,8 +73,8 @@ def get_response_message(config):
|
|
| 73 |
try:
|
| 74 |
response = requests.post(MODEL2SERVICE[config["model_name"]], headers=headers, json=data)
|
| 75 |
return response.json()["data"]
|
| 76 |
-
except:
|
| 77 |
-
return {"
|
| 78 |
|
| 79 |
|
| 80 |
def generate_questions(model_name, user_level, num_questions, question_type, language, explanation_language, context,
|
|
|
|
| 73 |
try:
|
| 74 |
response = requests.post(MODEL2SERVICE[config["model_name"]], headers=headers, json=data)
|
| 75 |
return response.json()["data"]
|
| 76 |
+
except Exception as e:
|
| 77 |
+
return {"error_message": f"{e}"}
|
| 78 |
|
| 79 |
|
| 80 |
def generate_questions(model_name, user_level, num_questions, question_type, language, explanation_language, context,
|