Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,21 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
gr.load("models/Qwen/Qwen2.5-Coder-32B-Instruct").launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
#gr.load("models/Qwen/Qwen2.5-Coder-32B-Instruct").launch()
|
4 |
+
from huggingface_hub import InferenceClient
|
5 |
+
|
6 |
+
client = InferenceClient(api_key="hf_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
|
7 |
+
|
8 |
+
messages = [
|
9 |
+
{
|
10 |
+
"role": "user",
|
11 |
+
"content": "What is the capital of France?"
|
12 |
+
}
|
13 |
+
]
|
14 |
+
|
15 |
+
completion = client.chat.completions.create(
|
16 |
+
model="Qwen/Qwen2.5-Coder-32B-Instruct",
|
17 |
+
messages=messages,
|
18 |
+
max_tokens=500
|
19 |
+
)
|
20 |
+
|
21 |
+
print(completion.choices[0].message)
|