Spaces:
Runtime error
Runtime error
Upload app.py
Browse files
app.py
CHANGED
|
@@ -31,20 +31,17 @@ examples = [
|
|
| 31 |
|
| 32 |
# Create Gradio UI
|
| 33 |
# Launch Gradio app with a submit button
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
)
|
| 46 |
-
|
| 47 |
-
btn.click(fn=generate_response, inputs=txt, outputs=gr.Textbox())
|
| 48 |
|
| 49 |
# Launch Gradio app
|
| 50 |
app.launch()
|
|
|
|
| 31 |
|
| 32 |
# Create Gradio UI
|
| 33 |
# Launch Gradio app with a submit button
|
| 34 |
+
# Create Gradio UI with a submit button
|
| 35 |
+
with gr.Blocks() as app:
|
| 36 |
+
gr.Markdown("## Phi-2 LoRA Model")
|
| 37 |
+
gr.Markdown("A fine-tuned Phi-2 model with LoRA running on Hugging Face Spaces (CPU optimized).")
|
| 38 |
+
txt = gr.Textbox(lines=2, placeholder="Enter your prompt here...")
|
| 39 |
+
btn = gr.Button("Submit")
|
| 40 |
+
output = gr.Textbox()
|
| 41 |
+
|
| 42 |
+
btn.click(fn=generate_response, inputs=txt, outputs=output)
|
| 43 |
+
|
| 44 |
+
gr.Examples(examples=[[ex] for ex in examples], inputs=txt)
|
|
|
|
|
|
|
|
|
|
| 45 |
|
| 46 |
# Launch Gradio app
|
| 47 |
app.launch()
|