Deadmon commited on
Commit
0d20d60
·
verified ·
1 Parent(s): 2be2104

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -3
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. Sign in with your Hugging Face account to use this API.")
7
- button = gr.LoginButton("Sign in")
8
- gr.load("models/Orion-zhen/Qwen2.5-7B-Instruct-Uncensored", accept_token=button, provider="featherless-ai")
 
 
 
 
 
 
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()