Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -506,9 +506,15 @@ with gr.Blocks(title="Code Assistant", theme=gr.themes.Soft()) as ui:
|
|
| 506 |
model = gr.Dropdown(["GPT", "Claude", "DeepSeek"], value="DeepSeek", label="Select Model")
|
| 507 |
with gr.Row():
|
| 508 |
explain_btn = gr.Button("🔍 Explain Code", variant="primary")
|
| 509 |
-
|
| 510 |
explain_btn.click(fn=explain_code, inputs=[code, model], outputs=[output])
|
| 511 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 512 |
# Launch the app
|
| 513 |
if __name__ == "__main__":
|
| 514 |
ui.launch()
|
|
|
|
| 506 |
model = gr.Dropdown(["GPT", "Claude", "DeepSeek"], value="DeepSeek", label="Select Model")
|
| 507 |
with gr.Row():
|
| 508 |
explain_btn = gr.Button("🔍 Explain Code", variant="primary")
|
| 509 |
+
explain_clear_btn = gr.Button("Clear")
|
| 510 |
explain_btn.click(fn=explain_code, inputs=[code, model], outputs=[output])
|
| 511 |
|
| 512 |
+
explain_clear_btn.click(
|
| 513 |
+
fn=lambda: ("", ""),
|
| 514 |
+
inputs=[],
|
| 515 |
+
outputs=[code,output]
|
| 516 |
+
)
|
| 517 |
+
|
| 518 |
# Launch the app
|
| 519 |
if __name__ == "__main__":
|
| 520 |
ui.launch()
|