Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,21 +1,4 @@
|
|
| 1 |
-
Your Hugging Face Space is ready to go. Below are the finalized files.
|
| 2 |
|
| 3 |
-
**Pro-Tip:** Since your token is named `TextToImage`, copy its string value (the one starting with `hf_...`) and paste it into the **Settings > Variables and Secrets** section of your Space under the name **`HF_TOKEN`**. The code is designed to look for that specific name to keep your credentials secure.
|
| 4 |
-
|
| 5 |
-
### 1. `requirements.txt`
|
| 6 |
-
This file ensures the Hugging Face environment installs the necessary libraries for Gradio and the Inference API.
|
| 7 |
-
|
| 8 |
-
```text
|
| 9 |
-
gradio
|
| 10 |
-
huggingface_hub
|
| 11 |
-
pillow
|
| 12 |
-
python-dotenv
|
| 13 |
-
```
|
| 14 |
-
|
| 15 |
-
### 2. `app.py`
|
| 16 |
-
This script contains the logic for your production app, including the style application and error handling.
|
| 17 |
-
|
| 18 |
-
```python
|
| 19 |
import os
|
| 20 |
import gradio as gr
|
| 21 |
from huggingface_hub import InferenceClient
|
|
|
|
|
|
|
| 1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
import os
|
| 3 |
import gradio as gr
|
| 4 |
from huggingface_hub import InferenceClient
|