Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -77,12 +77,17 @@ print("Model loaded successfully!")
|
|
77 |
# Define the Gradio interface
|
78 |
with gr.Blocks() as demo:
|
79 |
gr.Markdown("""
|
80 |
-
#
|
81 |
-
|
82 |
""")
|
83 |
|
84 |
-
# Initialize state
|
85 |
state = gr.State("")
|
|
|
|
|
|
|
|
|
|
|
86 |
|
87 |
with gr.Row():
|
88 |
with gr.Column(scale=2):
|
@@ -99,19 +104,14 @@ with gr.Blocks() as demo:
|
|
99 |
"Escribe un poema corto sobre la historia del Mediterráneo.",
|
100 |
"Jane has 8 apples. Solve this in Python."
|
101 |
]
|
|
|
102 |
for example in examples:
|
103 |
-
gr.Button(example)
|
|
|
104 |
lambda e=example: (e, state.value),
|
105 |
outputs=[user_input, state]
|
106 |
)
|
107 |
-
|
108 |
-
with gr.Row():
|
109 |
-
user_input = gr.Textbox(
|
110 |
-
label="Your Message",
|
111 |
-
placeholder="Type your question here...",
|
112 |
-
lines=3
|
113 |
-
)
|
114 |
-
submit_button = gr.Button("Submit")
|
115 |
|
116 |
output_text = gr.Textbox(
|
117 |
label="Athena's Response",
|
@@ -119,6 +119,8 @@ with gr.Blocks() as demo:
|
|
119 |
interactive=False
|
120 |
)
|
121 |
|
|
|
|
|
122 |
# Handle submission
|
123 |
submit_button.click(
|
124 |
generate_response,
|
|
|
77 |
# Define the Gradio interface
|
78 |
with gr.Blocks() as demo:
|
79 |
gr.Markdown("""
|
80 |
+
# Athena-1.1.5B Chat
|
81 |
+
Small, Smart, Super.
|
82 |
""")
|
83 |
|
84 |
+
# Initialize state and components
|
85 |
state = gr.State("")
|
86 |
+
user_input = gr.Textbox(
|
87 |
+
label="Your Message",
|
88 |
+
placeholder="Type your question here...",
|
89 |
+
lines=3
|
90 |
+
)
|
91 |
|
92 |
with gr.Row():
|
93 |
with gr.Column(scale=2):
|
|
|
104 |
"Escribe un poema corto sobre la historia del Mediterráneo.",
|
105 |
"Jane has 8 apples. Solve this in Python."
|
106 |
]
|
107 |
+
example_buttons = []
|
108 |
for example in examples:
|
109 |
+
example_button = gr.Button(example)
|
110 |
+
example_button.click(
|
111 |
lambda e=example: (e, state.value),
|
112 |
outputs=[user_input, state]
|
113 |
)
|
114 |
+
example_buttons.append(example_button)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
|
116 |
output_text = gr.Textbox(
|
117 |
label="Athena's Response",
|
|
|
119 |
interactive=False
|
120 |
)
|
121 |
|
122 |
+
submit_button = gr.Button("Submit")
|
123 |
+
|
124 |
# Handle submission
|
125 |
submit_button.click(
|
126 |
generate_response,
|