Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -4,9 +4,16 @@ import numpy as np
|
|
4 |
import os
|
5 |
|
6 |
from huggingface_hub import login
|
|
|
|
|
|
|
|
|
7 |
|
|
|
|
|
8 |
|
9 |
-
|
|
|
10 |
|
11 |
# Define a function that takes a text input and returns an image.
|
12 |
def text_to_image(text : str):
|
|
|
4 |
import os
|
5 |
|
6 |
from huggingface_hub import login
|
7 |
+
import os
|
8 |
+
|
9 |
+
# Retrieve the token from an environment variable
|
10 |
+
token = os.getenv('BLACK_FOREST_LABS_FLUX_1') # Replace with the correct variable name
|
11 |
|
12 |
+
if token is None:
|
13 |
+
raise ValueError("Token is not set in the environment variable.")
|
14 |
|
15 |
+
# Log in using the token
|
16 |
+
login(token=token)
|
17 |
|
18 |
# Define a function that takes a text input and returns an image.
|
19 |
def text_to_image(text : str):
|