Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -90,17 +90,11 @@ def bot(
|
|
90 |
time.sleep(0.01)
|
91 |
yield chatbot
|
92 |
|
93 |
-
# Componente para
|
94 |
-
system_instruction_component = gr.
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
"Use a friendly and conversational tone.",
|
99 |
-
"Focus on technical details only."
|
100 |
-
],
|
101 |
-
value="Provide a detailed and professional response.",
|
102 |
-
label="System Instruction",
|
103 |
-
scale=2
|
104 |
)
|
105 |
|
106 |
# Definir los componentes de entrada y salida
|
@@ -123,14 +117,18 @@ with gr.Blocks() as demo:
|
|
123 |
gr.HTML(TITLE)
|
124 |
gr.HTML(SUBTITLE)
|
125 |
with gr.Column():
|
|
|
126 |
model_choice_component.render()
|
127 |
-
system_instruction_component.render() # Mover junto al modelo
|
128 |
chatbot_component.render()
|
129 |
with gr.Row():
|
130 |
text_prompt_component.render()
|
131 |
upload_button_component.render()
|
132 |
run_button_component.render()
|
133 |
|
|
|
|
|
|
|
|
|
134 |
run_button_component.click(
|
135 |
fn=user,
|
136 |
inputs=user_inputs,
|
|
|
90 |
time.sleep(0.01)
|
91 |
yield chatbot
|
92 |
|
93 |
+
# Componente para el acorde贸n que contiene el cuadro de texto para la instrucci贸n del sistema
|
94 |
+
system_instruction_component = gr.Textbox(
|
95 |
+
placeholder="Enter system instruction...",
|
96 |
+
show_label=True,
|
97 |
+
scale=8
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
)
|
99 |
|
100 |
# Definir los componentes de entrada y salida
|
|
|
117 |
gr.HTML(TITLE)
|
118 |
gr.HTML(SUBTITLE)
|
119 |
with gr.Column():
|
120 |
+
# Campo de selecci贸n de modelo arriba
|
121 |
model_choice_component.render()
|
|
|
122 |
chatbot_component.render()
|
123 |
with gr.Row():
|
124 |
text_prompt_component.render()
|
125 |
upload_button_component.render()
|
126 |
run_button_component.render()
|
127 |
|
128 |
+
# Crear el acorde贸n para la instrucci贸n del sistema al final
|
129 |
+
with gr.Accordion("System Instruction", open=False): # Acorde贸n cerrado por defecto
|
130 |
+
system_instruction_component.render()
|
131 |
+
|
132 |
run_button_component.click(
|
133 |
fn=user,
|
134 |
inputs=user_inputs,
|