Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,8 @@
|
|
1 |
import gradio as gr
|
2 |
from huggingface_hub import InferenceClient
|
3 |
|
4 |
-
|
5 |
-
|
6 |
-
"""
|
7 |
-
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
8 |
-
|
9 |
|
10 |
def respond(
|
11 |
message,
|
@@ -35,20 +32,30 @@ def respond(
|
|
35 |
top_p=top_p,
|
36 |
):
|
37 |
token = message.choices[0].delta.content
|
38 |
-
|
39 |
response += token
|
40 |
yield response
|
41 |
|
42 |
-
|
43 |
-
"""
|
44 |
-
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
45 |
-
"""
|
46 |
demo = gr.ChatInterface(
|
47 |
respond,
|
48 |
additional_inputs=[
|
49 |
-
gr.Textbox(
|
50 |
-
|
51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
gr.Slider(
|
53 |
minimum=0.1,
|
54 |
maximum=1.0,
|
@@ -57,8 +64,10 @@ demo = gr.ChatInterface(
|
|
57 |
label="Top-p (nucleus sampling)",
|
58 |
),
|
59 |
],
|
|
|
|
|
60 |
)
|
61 |
|
62 |
-
|
63 |
if __name__ == "__main__":
|
64 |
demo.launch()
|
|
|
|
1 |
import gradio as gr
|
2 |
from huggingface_hub import InferenceClient
|
3 |
|
4 |
+
# Cambiar al modelo Latxa
|
5 |
+
client = InferenceClient("xezpeleta/latxa-7b-v1-gguf")
|
|
|
|
|
|
|
6 |
|
7 |
def respond(
|
8 |
message,
|
|
|
32 |
top_p=top_p,
|
33 |
):
|
34 |
token = message.choices[0].delta.content
|
|
|
35 |
response += token
|
36 |
yield response
|
37 |
|
|
|
|
|
|
|
|
|
38 |
demo = gr.ChatInterface(
|
39 |
respond,
|
40 |
additional_inputs=[
|
41 |
+
gr.Textbox(
|
42 |
+
value="Euskarazko laguntzaile adimentsua zara.",
|
43 |
+
label="Sistema mezua"
|
44 |
+
),
|
45 |
+
gr.Slider(
|
46 |
+
minimum=1,
|
47 |
+
maximum=2048,
|
48 |
+
value=512,
|
49 |
+
step=1,
|
50 |
+
label="Token maximoak"
|
51 |
+
),
|
52 |
+
gr.Slider(
|
53 |
+
minimum=0.1,
|
54 |
+
maximum=1.0,
|
55 |
+
value=0.7,
|
56 |
+
step=0.1,
|
57 |
+
label="Temperatura"
|
58 |
+
),
|
59 |
gr.Slider(
|
60 |
minimum=0.1,
|
61 |
maximum=1.0,
|
|
|
64 |
label="Top-p (nucleus sampling)",
|
65 |
),
|
66 |
],
|
67 |
+
title="Latxa LLM Chatbot",
|
68 |
+
description="Euskarazko chatbot adimentsua"
|
69 |
)
|
70 |
|
|
|
71 |
if __name__ == "__main__":
|
72 |
demo.launch()
|
73 |
+
|