fix login again
Browse files
app.py
CHANGED
@@ -10,7 +10,10 @@ TOKEN = None
|
|
10 |
|
11 |
def get_token(oauth_token: gr.OAuthToken | None):
|
12 |
global TOKEN
|
13 |
-
|
|
|
|
|
|
|
14 |
|
15 |
def infer(prompt, seed=42, randomize_seed=False, width=1024, height=1024, num_inference_steps=4, progress=gr.Progress(track_tqdm=True)):
|
16 |
client = InferenceClient(provider="fal-ai", token=TOKEN)
|
|
|
10 |
|
11 |
def get_token(oauth_token: gr.OAuthToken | None):
|
12 |
global TOKEN
|
13 |
+
if oauth_token and oauth_token.token:
|
14 |
+
TOKEN = oauth_token.token
|
15 |
+
else:
|
16 |
+
TOKEN = os.getenv("HF_TOKEN")
|
17 |
|
18 |
def infer(prompt, seed=42, randomize_seed=False, width=1024, height=1024, num_inference_steps=4, progress=gr.Progress(track_tqdm=True)):
|
19 |
client = InferenceClient(provider="fal-ai", token=TOKEN)
|