Update app.py
Browse files
app.py
CHANGED
@@ -31,26 +31,11 @@ def generate_response(prompt):
|
|
31 |
# Define the Gradio interface
|
32 |
interface = gr.Interface(
|
33 |
fn=generate_response,
|
34 |
-
inputs=gr.Textbox(
|
35 |
-
|
36 |
-
placeholder="Enter your prompt here...",
|
37 |
-
label="Prompt",
|
38 |
-
elem_id="input-textbox" # Custom styling ID for input textbox
|
39 |
-
),
|
40 |
-
outputs=gr.Textbox(
|
41 |
-
label="Generated Text",
|
42 |
-
elem_id="output-textbox" # Custom styling ID for output textbox
|
43 |
-
),
|
44 |
title="Polymer Knowledge Model",
|
45 |
-
description=
|
46 |
-
"This application uses a fine-tuned model to generate text related to polymers. "
|
47 |
-
"Enter a prompt to get started, and the model will generate relevant text."
|
48 |
-
),
|
49 |
-
theme="huggingface", # Apply a theme for consistent styling
|
50 |
-
layout="horizontal", # Arrange input and output side by side
|
51 |
-
live=True # Update the output live as the user types
|
52 |
)
|
53 |
|
54 |
# Launch the interface
|
55 |
interface.launch()
|
56 |
-
|
|
|
31 |
# Define the Gradio interface
|
32 |
interface = gr.Interface(
|
33 |
fn=generate_response,
|
34 |
+
inputs=gr.Textbox(lines=2, placeholder="Enter your prompt here...", label="Prompt"),
|
35 |
+
outputs="text",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
title="Polymer Knowledge Model",
|
37 |
+
description="A model fine-tuned for generating text related to polymers."
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
)
|
39 |
|
40 |
# Launch the interface
|
41 |
interface.launch()
|
|