Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,11 +3,15 @@ from huggingface_hub import InferenceClient
|
|
| 3 |
from datasets import load_dataset
|
| 4 |
import threading
|
| 5 |
import time
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
"""
|
| 8 |
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
|
| 9 |
"""
|
| 10 |
-
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
| 11 |
|
| 12 |
|
| 13 |
def load_data():
|
|
@@ -82,7 +86,7 @@ demo = gr.ChatInterface(
|
|
| 82 |
additional_inputs=[
|
| 83 |
gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
|
| 84 |
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
| 85 |
-
gr.Slider(minimum=0.1, maximum
|
| 86 |
gr.Slider(
|
| 87 |
minimum=0.1,
|
| 88 |
maximum=1.0,
|
|
|
|
| 3 |
from datasets import load_dataset
|
| 4 |
import threading
|
| 5 |
import time
|
| 6 |
+
import os
|
| 7 |
+
|
| 8 |
+
# Your Hugging Face API token
|
| 9 |
+
API_TOKEN = os.getenv("token")
|
| 10 |
|
| 11 |
"""
|
| 12 |
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
|
| 13 |
"""
|
| 14 |
+
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta", token=API_TOKEN)
|
| 15 |
|
| 16 |
|
| 17 |
def load_data():
|
|
|
|
| 86 |
additional_inputs=[
|
| 87 |
gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
|
| 88 |
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
| 89 |
+
gr.Slider(minimum=0.1, maximum 4.0, value=0.7, step=0.1, label="Temperature"),
|
| 90 |
gr.Slider(
|
| 91 |
minimum=0.1,
|
| 92 |
maximum=1.0,
|