Monimoy commited on
Commit
9c56d8a
·
verified ·
1 Parent(s): 9528e62

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -14
app.py CHANGED
@@ -31,20 +31,17 @@ examples = [
31
 
32
  # Create Gradio UI
33
  # Launch Gradio app with a submit button
34
- txt = gr.Textbox(lines=2, placeholder="Enter your prompt here...")
35
- btn = gr.Button("Submit")
36
-
37
- app = gr.Interface(
38
- fn=generate_response,
39
- inputs=txt,
40
- outputs=gr.Textbox(),
41
- title="Phi-2 LoRA Model",
42
- description="A fine-tuned Phi-2 model with LoRA running on Hugging Face Spaces (CPU optimized).",
43
- examples=[[ex] for ex in examples],
44
- allow_flagging="never"
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()