Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,3 @@
|
|
| 1 |
-
import os
|
| 2 |
import gradio as gr
|
| 3 |
from huggingface_hub import InferenceClient
|
| 4 |
|
|
@@ -42,14 +41,16 @@ def generate(
|
|
| 42 |
mychatbot = gr.Chatbot(
|
| 43 |
avatar_images=["./user.png", "./botm.png"], bubble_full_width=False, show_label=False, show_copy_button=True, likeable=True,)
|
| 44 |
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
inputs=[gr.Textbox("prompt", placeholder="Escribe aquí tu mensaje"), gr.Textbox("context", label="Contexto", placeholder="Ingresa el contexto")],
|
| 48 |
-
title="Mixtral 8x7b Chat",
|
| 49 |
-
retry_btn=None,
|
| 50 |
-
undo_btn=None
|
| 51 |
-
)
|
| 52 |
|
| 53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
|
| 55 |
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from huggingface_hub import InferenceClient
|
| 3 |
|
|
|
|
| 41 |
mychatbot = gr.Chatbot(
|
| 42 |
avatar_images=["./user.png", "./botm.png"], bubble_full_width=False, show_label=False, show_copy_button=True, likeable=True,)
|
| 43 |
|
| 44 |
+
textbox_prompt = gr.Textbox("prompt", placeholder="Escribe aquí tu mensaje")
|
| 45 |
+
textbox_context = gr.Textbox("context", label="Contexto", placeholder="Ingresa el contexto")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
+
iface = gr.Interface(
|
| 48 |
+
fn=generate,
|
| 49 |
+
inputs=[textbox_prompt, textbox_context],
|
| 50 |
+
outputs=gr.Textbox(),
|
| 51 |
+
live=True
|
| 52 |
+
)
|
| 53 |
+
|
| 54 |
+
iface.launch(share=True)
|
| 55 |
|
| 56 |
|