Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
from huggingface_hub import InferenceClient
|
2 |
import os
|
|
|
3 |
|
4 |
hf_token = os.getenv("HF_TOKEN").strip()
|
5 |
|
@@ -19,4 +20,14 @@ stream = client.chat.completions.create(
|
|
19 |
)
|
20 |
|
21 |
for chunk in stream:
|
22 |
-
print(chunk.choices[0].delta.content)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
from huggingface_hub import InferenceClient
|
2 |
import os
|
3 |
+
import gradio as gr
|
4 |
|
5 |
hf_token = os.getenv("HF_TOKEN").strip()
|
6 |
|
|
|
20 |
)
|
21 |
|
22 |
for chunk in stream:
|
23 |
+
print(chunk.choices[0].delta.content)
|
24 |
+
|
25 |
+
demo = gr.ChatInterface(
|
26 |
+
fn=chat_with_model,
|
27 |
+
title="ACC-o3",
|
28 |
+
description="ACC=o3 is a powerful model created by the ACC.",
|
29 |
+
examples=["How many 'r's are in strawberry?", "Tell me about the ACC.", "Who are you?"]
|
30 |
+
)
|
31 |
+
|
32 |
+
if __name__ == "__main__":
|
33 |
+
demo.launch()
|