Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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
|
57 |
prompt = gr.Textbox(label="Enter your prompt:", lines=2)
|
|
|
|
|
58 |
output = gr.Textbox(label="Generated text:", lines=5)
|
|
|
|
|
|
|
59 |
|
60 |
-
#
|
61 |
-
|
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)
|