ShankarC commited on
Commit
6efca78
·
verified ·
1 Parent(s): e1e5071

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -9
app.py CHANGED
@@ -1,15 +1,14 @@
1
  import os
2
  import gradio as gr
3
 
4
- # Replace with your private Space repo ID, e.g. "username/private-space-name"
5
- PRIVATE_SPACE_ID = "AIStockAdvisor/StockAdvisorCL"
6
 
7
- hf_token = os.getenv("HF_TOKEN") # Set this in your public Space secrets
 
 
8
 
9
- demo = gr.Interface.load(
10
- PRIVATE_SPACE_ID,
11
- hf_token=hf_token
12
- )
13
 
14
- if __name__ == "__main__":
15
- demo.launch()
 
1
  import os
2
  import gradio as gr
3
 
4
+ # Get your Hugging Face API token from Space secrets
5
+ hf_token = os.environ.get('HF_TOKEN') # Or another secret name you set
6
 
7
+ # Load the Gradio Blocks from the private Space
8
+ # Replace "your-username-or-org" and "your-private-space-name" with your details
9
+ iface = gr.load(name="AIStockAdvisor/StockAdvisorCL", hf_token=hf_token, src='spaces')
10
 
11
+ # Optional: Disable the API endpoint of the loaded interface
12
+ # iface.queue(api_open=False).launch(show_api=False) # Or you might just call launch() directly
13
+ iface.launch()
 
14