Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,20 +14,16 @@ def generate_questions(context, num_questions):
|
|
| 14 |
except Exception as e:
|
| 15 |
return f"Error generating questions: {str(e)}"
|
| 16 |
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
["Machine learning is a subset of artificial intelligence that focuses on the use of data and algorithms to imitate the way that humans learn.", 3]
|
| 29 |
-
]
|
| 30 |
-
)
|
| 31 |
|
| 32 |
-
|
| 33 |
-
iface.launch()
|
|
|
|
| 14 |
except Exception as e:
|
| 15 |
return f"Error generating questions: {str(e)}"
|
| 16 |
|
| 17 |
+
with gr.Blocks(css="""
|
| 18 |
+
[dir="rtl"] {
|
| 19 |
+
direction: rtl;
|
| 20 |
+
}
|
| 21 |
+
""") as iface:
|
| 22 |
+
with gr.Row():
|
| 23 |
+
with gr.Column():
|
| 24 |
+
context = gr.Textbox(lines=5, label="Text Context", dir="rtl")
|
| 25 |
+
with gr.Column():
|
| 26 |
+
num_questions = gr.Slider(minimum=1, maximum=5, step=1, label="Number of Questions")
|
| 27 |
+
output = gr.Textbox(label="Generated Questions", dir="rtl")
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
+
iface.launch()
|
|
|