Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,14 +1,10 @@
|
|
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 |
title = "rahul7star bot"
|
10 |
|
11 |
-
|
12 |
def respond(
|
13 |
message,
|
14 |
history: list[tuple[str, str]],
|
@@ -30,7 +26,6 @@ def respond(
|
|
30 |
response = title + ""
|
31 |
|
32 |
for message in client.chat_completion(
|
33 |
-
|
34 |
messages,
|
35 |
max_tokens=max_tokens,
|
36 |
stream=True,
|
@@ -42,12 +37,7 @@ def respond(
|
|
42 |
response += token
|
43 |
yield response
|
44 |
|
45 |
-
|
46 |
-
"""
|
47 |
-
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
48 |
-
"""
|
49 |
demo = gr.ChatInterface(
|
50 |
-
|
51 |
respond,
|
52 |
additional_inputs=[
|
53 |
gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
|
|
|
1 |
import gradio as gr
|
2 |
from huggingface_hub import InferenceClient
|
3 |
|
4 |
+
client = InferenceClient("rahul7star/zero-ai-model") # Replace with your actual model path on Hugging Face Hub
|
|
|
|
|
|
|
5 |
|
6 |
title = "rahul7star bot"
|
7 |
|
|
|
8 |
def respond(
|
9 |
message,
|
10 |
history: list[tuple[str, str]],
|
|
|
26 |
response = title + ""
|
27 |
|
28 |
for message in client.chat_completion(
|
|
|
29 |
messages,
|
30 |
max_tokens=max_tokens,
|
31 |
stream=True,
|
|
|
37 |
response += token
|
38 |
yield response
|
39 |
|
|
|
|
|
|
|
|
|
40 |
demo = gr.ChatInterface(
|
|
|
41 |
respond,
|
42 |
additional_inputs=[
|
43 |
gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
|