Spaces:
Sleeping
Sleeping
init
Browse files
app.py
CHANGED
@@ -71,7 +71,7 @@ def get_response_message(config):
|
|
71 |
response = requests.post(MODEL2SERVICE[config["model_name"]], headers=headers, json=data)
|
72 |
return response.json()["data"]
|
73 |
except:
|
74 |
-
return {"message": f"Hiện tại chúng tôi chưa hỗ trợ mô hình {config['model_name']}"}
|
75 |
|
76 |
def generate_questions(model_name, user_level, num_questions, question_type, language, explanation_language, context, learning_outcomes, mode):
|
77 |
if mode == "Reviewing" and not context.strip():
|
@@ -100,7 +100,7 @@ iface = gr.Interface(
|
|
100 |
gr.Dropdown(["Short answer", "Single choice", "Multiple choice"], label="Question Type"),
|
101 |
gr.Dropdown(["English", "Vietnamese"], label="Language"),
|
102 |
gr.Dropdown(["English", "Vietnamese"], label="Explanation Language"),
|
103 |
-
gr.Textbox(lines=5, placeholder="Enter context here...", label="Context"),
|
104 |
gr.Textbox(lines=5, value=template_los, label="Learning Outcomes"),
|
105 |
gr.Dropdown(["Reviewing", "Practicing"], label="Mode")
|
106 |
],
|
|
|
71 |
response = requests.post(MODEL2SERVICE[config["model_name"]], headers=headers, json=data)
|
72 |
return response.json()["data"]
|
73 |
except:
|
74 |
+
return {"message": f"Hiện tại chúng tôi chưa hỗ trợ mô hình {config['model_name']}."}
|
75 |
|
76 |
def generate_questions(model_name, user_level, num_questions, question_type, language, explanation_language, context, learning_outcomes, mode):
|
77 |
if mode == "Reviewing" and not context.strip():
|
|
|
100 |
gr.Dropdown(["Short answer", "Single choice", "Multiple choice"], label="Question Type"),
|
101 |
gr.Dropdown(["English", "Vietnamese"], label="Language"),
|
102 |
gr.Dropdown(["English", "Vietnamese"], label="Explanation Language"),
|
103 |
+
gr.Textbox(lines=5, placeholder="Enter context here...", label="Context (Lesson content or Reading comprehension passage)"),
|
104 |
gr.Textbox(lines=5, value=template_los, label="Learning Outcomes"),
|
105 |
gr.Dropdown(["Reviewing", "Practicing"], label="Mode")
|
106 |
],
|