Spaces:
Runtime error
Runtime error
Update app.py
Browse files<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/6743bed2f6b05a786ed5004b/DTHRwHIQTq6XuK8COxuWE.mpga"></audio>
app.py
CHANGED
@@ -2,8 +2,10 @@ import gradio as gr
|
|
2 |
from huggingface_hub import InferenceClient
|
3 |
import os
|
4 |
|
5 |
-
|
|
|
6 |
|
|
|
7 |
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta", token=HF_TOKEN)
|
8 |
|
9 |
def respond(
|
@@ -34,7 +36,6 @@ def respond(
|
|
34 |
top_p=top_p,
|
35 |
):
|
36 |
token = message.choices[0].delta.content
|
37 |
-
|
38 |
response += token
|
39 |
yield response
|
40 |
|
|
|
2 |
from huggingface_hub import InferenceClient
|
3 |
import os
|
4 |
|
5 |
+
# The token is securely pulled from the Hugging Face Space Secret named HUGGINGFACEHUB_API_TOKEN
|
6 |
+
HF_TOKEN = os.getenv("HUGGINGFACEHUB_API_TOKEN")
|
7 |
|
8 |
+
# Setup the inference client with your model and token
|
9 |
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta", token=HF_TOKEN)
|
10 |
|
11 |
def respond(
|
|
|
36 |
top_p=top_p,
|
37 |
):
|
38 |
token = message.choices[0].delta.content
|
|
|
39 |
response += token
|
40 |
yield response
|
41 |
|