File size: 698 Bytes
3d1c3ea
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a7fb125
 
26e0101
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import gradio as gr
import os

# 1. This securely reads the token you just saved in the Space's settings.
# The token itself is NOT in the code.
hf_token = os.environ.get("HF_TOKEN")

if not hf_token:
    raise ValueError("HF_TOKEN secret is not set. Please add it to your Space settings.")

# 2. This uses your secret token to "unlock" and load your private Space.
print(f"Attempting to load private Space: spaces/StatsTech/StatsEasy")
demo = gr.load("spaces/StatsTech/StatsEasy", hf_token=hf_token)
print("Private Space loaded successfully.")

# 3. This launches the loaded app.
demo.launch()

import gradio as gr

demo = gr.load("spaces/StatsTech/StatsEasy")
demo.launch()