Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -82,15 +82,21 @@ def generate_output(prompt_type, query):
|
|
| 82 |
chain = LLMChain(llm=llm, prompt=templates[prompt_type])
|
| 83 |
return chain.run({"context": context, "query": query})
|
| 84 |
|
| 85 |
-
# Gradio UI
|
| 86 |
with gr.Blocks() as demo:
|
| 87 |
-
gr.Markdown("# 📐 Geometry Assistant")
|
| 88 |
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
|
|
|
|
| 93 |
btn = gr.Button("Generate")
|
|
|
|
| 94 |
btn.click(fn=generate_output, inputs=[prompt_type, query], outputs=output)
|
| 95 |
|
| 96 |
demo.launch()
|
|
|
|
| 82 |
chain = LLMChain(llm=llm, prompt=templates[prompt_type])
|
| 83 |
return chain.run({"context": context, "query": query})
|
| 84 |
|
| 85 |
+
# ✅ Gradio UI
|
| 86 |
with gr.Blocks() as demo:
|
| 87 |
+
gr.Markdown("# 📐 Geometry Teaching Assistant")
|
| 88 |
|
| 89 |
+
with gr.Row():
|
| 90 |
+
query = gr.Textbox(label="Enter a geometry topic")
|
| 91 |
+
prompt_type = gr.Dropdown(
|
| 92 |
+
["flashcard", "lesson plan", "worksheet", "proofs"],
|
| 93 |
+
value="flashcard",
|
| 94 |
+
label="Prompt Type"
|
| 95 |
+
)
|
| 96 |
|
| 97 |
+
output = gr.Textbox(label="Generated Output", lines=12, interactive=True)
|
| 98 |
btn = gr.Button("Generate")
|
| 99 |
+
|
| 100 |
btn.click(fn=generate_output, inputs=[prompt_type, query], outputs=output)
|
| 101 |
|
| 102 |
demo.launch()
|