Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -1,9 +1,7 @@
|
|
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 |
|
@@ -15,15 +13,11 @@ def respond(
|
|
15 |
temperature,
|
16 |
top_p,
|
17 |
):
|
18 |
-
messages = [
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
if val[1]:
|
24 |
-
messages.append({"role": "assistant", "content": val[1]})
|
25 |
-
|
26 |
-
messages.append({"role": "user", "content": message})
|
27 |
|
28 |
response = ""
|
29 |
|
|
|
1 |
import gradio as gr
|
2 |
from huggingface_hub import InferenceClient
|
3 |
+
from transformers import pipeline
|
4 |
|
|
|
|
|
|
|
5 |
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
6 |
|
7 |
|
|
|
13 |
temperature,
|
14 |
top_p,
|
15 |
):
|
16 |
+
messages = [
|
17 |
+
{"role": "user", "content": "Who are you?"},
|
18 |
+
]
|
19 |
+
pipe = pipeline("text-generation", model="codefuse-ai/CodeFuse-DeepSeek-33B")
|
20 |
+
pipe(messages)
|
|
|
|
|
|
|
|
|
21 |
|
22 |
response = ""
|
23 |
|