Update app.py
Browse files
app.py
CHANGED
|
@@ -1,10 +1,20 @@
|
|
| 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 Orion-zhen/Qwen2.5-7B-Instruct-Uncensored model, served by the featherless-ai API.
|
| 7 |
-
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
demo.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import os
|
| 3 |
+
|
| 4 |
+
# Get the Hugging Face token from the Space's secrets
|
| 5 |
+
HF_TOKEN = os.environ.get("HF_TOKEN")
|
| 6 |
|
| 7 |
with gr.Blocks(fill_height=True) as demo:
|
| 8 |
with gr.Sidebar():
|
| 9 |
gr.Markdown("# Inference Provider")
|
| 10 |
+
gr.Markdown("This Space showcases the Orion-zhen/Qwen2.5-7B-Instruct-Uncensored model, served by the featherless-ai API.")
|
| 11 |
+
|
| 12 |
+
# Use the HF_TOKEN from the environment to authenticate.
|
| 13 |
+
# The LoginButton is removed as it's not compatible with a headless React client.
|
| 14 |
+
gr.load(
|
| 15 |
+
"models/Orion-zhen/Qwen2.5-7B-Instruct-Uncensored",
|
| 16 |
+
hf_token=HF_TOKEN,
|
| 17 |
+
provider="featherless-ai"
|
| 18 |
+
)
|
| 19 |
|
| 20 |
demo.launch()
|