Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,3 @@
|
|
| 1 |
-
|
| 2 |
import os
|
| 3 |
import gradio as gr
|
| 4 |
from huggingface_hub import InferenceClient
|
|
@@ -23,7 +22,7 @@ def authenticate_client():
|
|
| 23 |
Retrieves the 'TextToImage' token (stored as HF_TOKEN secret)
|
| 24 |
from the Space environment.
|
| 25 |
"""
|
| 26 |
-
hf_token = os.getenv("
|
| 27 |
if not hf_token:
|
| 28 |
raise ValueError("HF_TOKEN secret not found. Please add your 'TextToImage' token to Space Secrets.")
|
| 29 |
return InferenceClient(token=hf_token)
|
|
@@ -106,5 +105,4 @@ def build_app():
|
|
| 106 |
|
| 107 |
if __name__ == "__main__":
|
| 108 |
app = build_app()
|
| 109 |
-
app.launch()
|
| 110 |
-
```
|
|
|
|
|
|
|
| 1 |
import os
|
| 2 |
import gradio as gr
|
| 3 |
from huggingface_hub import InferenceClient
|
|
|
|
| 22 |
Retrieves the 'TextToImage' token (stored as HF_TOKEN secret)
|
| 23 |
from the Space environment.
|
| 24 |
"""
|
| 25 |
+
hf_token = os.getenv("HF_TOKEN")
|
| 26 |
if not hf_token:
|
| 27 |
raise ValueError("HF_TOKEN secret not found. Please add your 'TextToImage' token to Space Secrets.")
|
| 28 |
return InferenceClient(token=hf_token)
|
|
|
|
| 105 |
|
| 106 |
if __name__ == "__main__":
|
| 107 |
app = build_app()
|
| 108 |
+
app.launch()
|
|
|