Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
import os
|
2 |
import gradio as gr
|
3 |
|
4 |
-
#
|
5 |
hf_token = os.getenv("HF_TOKEN")
|
6 |
|
7 |
-
# Load a private Hugging Face Space
|
8 |
-
app = gr.load("segestic/Token-and-Cost-Calculator",
|
9 |
|
10 |
# Use the app
|
11 |
output = app("Input text")
|
|
|
1 |
import os
|
2 |
import gradio as gr
|
3 |
|
4 |
+
# Access the Hugging Face token from environment variables
|
5 |
hf_token = os.getenv("HF_TOKEN")
|
6 |
|
7 |
+
# Load a private Hugging Face Space using the updated `token` parameter and `src='spaces'`
|
8 |
+
app = gr.load(name="spaces/segestic/Token-and-Cost-Calculator", src="spaces", token=hf_token)
|
9 |
|
10 |
# Use the app
|
11 |
output = app("Input text")
|