Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,21 +1,19 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
from huggingface_hub import InferenceClient
|
3 |
|
4 |
-
""
|
5 |
-
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
6 |
-
"""
|
7 |
-
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
8 |
|
|
|
9 |
|
10 |
def respond(
|
11 |
message,
|
12 |
history: list[tuple[str, str]],
|
13 |
-
system_message,
|
14 |
max_tokens,
|
15 |
temperature,
|
16 |
top_p,
|
17 |
):
|
18 |
-
messages = [{"role": "system", "content":
|
19 |
|
20 |
for val in history:
|
21 |
if val[0]:
|
@@ -40,15 +38,11 @@ def respond(
|
|
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.
|
50 |
-
gr.Slider(minimum=1, maximum=
|
51 |
-
gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
|
52 |
gr.Slider(
|
53 |
minimum=0.1,
|
54 |
maximum=1.0,
|
|
|
1 |
import gradio as gr
|
2 |
+
import os
|
3 |
from huggingface_hub import InferenceClient
|
4 |
|
5 |
+
client = InferenceClient("explorewithai/Loxa-3B")
|
|
|
|
|
|
|
6 |
|
7 |
+
meo_system = os.environ.get("MEO")
|
8 |
|
9 |
def respond(
|
10 |
message,
|
11 |
history: list[tuple[str, str]],
|
|
|
12 |
max_tokens,
|
13 |
temperature,
|
14 |
top_p,
|
15 |
):
|
16 |
+
messages = [{"role": "system", "content": meo_system}]
|
17 |
|
18 |
for val in history:
|
19 |
if val[0]:
|
|
|
38 |
yield response
|
39 |
|
40 |
|
|
|
|
|
|
|
41 |
demo = gr.ChatInterface(
|
42 |
respond,
|
43 |
additional_inputs=[
|
44 |
+
gr.Slider(minimum=1, maximum=2048, value=2048, step=1, label="Max new tokens"),
|
45 |
+
gr.Slider(minimum=0.1, maximum=1.0, value=0.7, step=0.1, label="Temperature"),
|
|
|
46 |
gr.Slider(
|
47 |
minimum=0.1,
|
48 |
maximum=1.0,
|