Spaces:
Runtime error
Runtime error
update to fix
Browse files- app.py +0 -3
- app_huggingface.py +10 -4
app.py
CHANGED
@@ -1,6 +1,5 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
from app_huggingface import demo as demo_huggingface
|
4 |
from app_allenai import demo as demo_allenai
|
5 |
from app_claude import demo as demo_claude
|
6 |
from app_experimental import demo as demo_experimental
|
@@ -21,8 +20,6 @@ from app_together import demo as demo_together
|
|
21 |
from app_xai import demo as demo_grok
|
22 |
|
23 |
with gr.Blocks(fill_height=True) as demo:
|
24 |
-
with gr.Tab("Hugging Face"):
|
25 |
-
demo_huggingface.render()
|
26 |
with gr.Tab("Grok"):
|
27 |
demo_grok.render()
|
28 |
with gr.Tab("Hyperbolic"):
|
|
|
1 |
import gradio as gr
|
2 |
|
|
|
3 |
from app_allenai import demo as demo_allenai
|
4 |
from app_claude import demo as demo_claude
|
5 |
from app_experimental import demo as demo_experimental
|
|
|
20 |
from app_xai import demo as demo_grok
|
21 |
|
22 |
with gr.Blocks(fill_height=True) as demo:
|
|
|
|
|
23 |
with gr.Tab("Grok"):
|
24 |
demo_grok.render()
|
25 |
with gr.Tab("Hyperbolic"):
|
app_huggingface.py
CHANGED
@@ -8,8 +8,13 @@ MODELS = {
|
|
8 |
def create_chat_fn(client):
|
9 |
def chat(message, history):
|
10 |
response = client.predict(
|
11 |
-
message=message,
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
13 |
api_name="/chat"
|
14 |
)
|
15 |
return response
|
@@ -42,7 +47,8 @@ with gr.Blocks() as demo:
|
|
42 |
|
43 |
chat_interface = gr.ChatInterface(
|
44 |
fn=safe_chat_fn,
|
45 |
-
additional_inputs=[client]
|
|
|
46 |
)
|
47 |
|
48 |
# Update client when model changes
|
@@ -64,4 +70,4 @@ with gr.Blocks() as demo:
|
|
64 |
|
65 |
demo = demo
|
66 |
|
67 |
-
|
|
|
8 |
def create_chat_fn(client):
|
9 |
def chat(message, history):
|
10 |
response = client.predict(
|
11 |
+
message={"text": message, "files": []},
|
12 |
+
system_prompt="You are a helpful AI assistant.",
|
13 |
+
temperature=0.7,
|
14 |
+
max_new_tokens=1024,
|
15 |
+
top_k=40,
|
16 |
+
repetition_penalty=1.1,
|
17 |
+
top_p=0.95,
|
18 |
api_name="/chat"
|
19 |
)
|
20 |
return response
|
|
|
47 |
|
48 |
chat_interface = gr.ChatInterface(
|
49 |
fn=safe_chat_fn,
|
50 |
+
additional_inputs=[client],
|
51 |
+
multimodal=True
|
52 |
)
|
53 |
|
54 |
# Update client when model changes
|
|
|
70 |
|
71 |
demo = demo
|
72 |
|
73 |
+
demo.launch()
|