Update app.py
Browse files
app.py
CHANGED
|
@@ -1,27 +1,10 @@
|
|
| 1 |
-
import requests
|
| 2 |
import gradio as gr
|
| 3 |
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
messages.append({"role": "user", "content": message})
|
| 11 |
|
| 12 |
-
|
| 13 |
-
"model": "accounts/fireworks/models/qwen3-235b-a22b-instruct-2507",
|
| 14 |
-
"messages": messages,
|
| 15 |
-
"max_tokens": 8192, # Push this higher
|
| 16 |
-
"temperature": 0.7,
|
| 17 |
-
"top_p": 0.9,
|
| 18 |
-
"stream": False
|
| 19 |
-
}
|
| 20 |
-
|
| 21 |
-
response = requests.post(
|
| 22 |
-
"https://api.fireworks.ai/inference/v1/chat/completions",
|
| 23 |
-
headers={"Authorization": f"Bearer {your_api_key}"},
|
| 24 |
-
json=payload
|
| 25 |
-
)
|
| 26 |
-
|
| 27 |
-
return response.json()["choices"][0]["message"]["content"]
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
+
with gr.Blocks(fill_height=True) as demo:
|
| 4 |
+
with gr.Sidebar():
|
| 5 |
+
gr.Markdown("# Inference Provider")
|
| 6 |
+
gr.Markdown("This Space showcases the Qwen/Qwen3-235B-A22B-Instruct-2507 model, served by the fireworks-ai API. Sign in with your Hugging Face account to use this API.")
|
| 7 |
+
button = gr.LoginButton("Sign in")
|
| 8 |
+
gr.load("models/Qwen/Qwen3-235B-A22B-Instruct-2507", accept_token=button, provider="fireworks-ai")
|
|
|
|
| 9 |
|
| 10 |
+
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|