Commit Β·
709d65d
1
Parent(s): bd92c2f
Update app.py
Browse files
app.py
CHANGED
|
@@ -211,7 +211,7 @@ def start_training(
|
|
| 211 |
if(oauth_token is None):
|
| 212 |
raise gr.Error("You aren't logged in!")
|
| 213 |
else:
|
| 214 |
-
token = oauth_token
|
| 215 |
if not lora_name:
|
| 216 |
raise gr.Error("You forgot to insert your LoRA name! This name has to be unique.")
|
| 217 |
print("Started training")
|
|
@@ -470,9 +470,8 @@ def run_captioning(*inputs):
|
|
| 470 |
final_captions[index] = final_caption
|
| 471 |
yield final_captions
|
| 472 |
|
| 473 |
-
def check_token(
|
| 474 |
-
|
| 475 |
-
print(token)
|
| 476 |
try:
|
| 477 |
api = HfApi(token=token)
|
| 478 |
user_data = api.whoami()
|
|
|
|
| 211 |
if(oauth_token is None):
|
| 212 |
raise gr.Error("You aren't logged in!")
|
| 213 |
else:
|
| 214 |
+
token = oauth_token.token
|
| 215 |
if not lora_name:
|
| 216 |
raise gr.Error("You forgot to insert your LoRA name! This name has to be unique.")
|
| 217 |
print("Started training")
|
|
|
|
| 470 |
final_captions[index] = final_caption
|
| 471 |
yield final_captions
|
| 472 |
|
| 473 |
+
def check_token(OAuthToken: gr.OAuthToken | None):
|
| 474 |
+
token = OAuthToken.token
|
|
|
|
| 475 |
try:
|
| 476 |
api = HfApi(token=token)
|
| 477 |
user_data = api.whoami()
|