Shriti09 commited on
Commit
b8d9fc5
·
verified ·
1 Parent(s): 89ef257

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -53,12 +53,17 @@ def generate_text(prompt):
53
  with gr.Blocks(theme=gr.themes.Soft()) as demo:
54
  gr.Markdown("<h1>🧠 Phi-2 QLoRA Text Generator</h1>")
55
 
56
- # Textbox for user input and a button to generate text
57
  prompt = gr.Textbox(label="Enter your prompt:", lines=2)
 
 
58
  output = gr.Textbox(label="Generated text:", lines=5)
 
 
 
59
 
60
- # Generate text when the button is clicked
61
- prompt.submit(generate_text, prompt, output)
62
 
63
  # Launch the app
64
  demo.launch(share=True)
 
53
  with gr.Blocks(theme=gr.themes.Soft()) as demo:
54
  gr.Markdown("<h1>🧠 Phi-2 QLoRA Text Generator</h1>")
55
 
56
+ # Textbox for user input
57
  prompt = gr.Textbox(label="Enter your prompt:", lines=2)
58
+
59
+ # Output textbox for generated text
60
  output = gr.Textbox(label="Generated text:", lines=5)
61
+
62
+ # Button to trigger text generation
63
+ generate_button = gr.Button("Generate Text")
64
 
65
+ # Set the button action to generate text
66
+ generate_button.click(generate_text, inputs=prompt, outputs=output)
67
 
68
  # Launch the app
69
  demo.launch(share=True)