Update app.py
Browse files
app.py
CHANGED
@@ -86,8 +86,12 @@ def guess_base_model(ft_model_id):
|
|
86 |
|
87 |
|
88 |
def process_model(ft_model_id: str, base_model_id: str, rank: str, private_repo, oauth_token: gr.OAuthToken | None):
|
89 |
-
|
|
|
|
|
|
|
90 |
raise gr.Error("You must be logged in")
|
|
|
91 |
model_name = ft_model_id.split('/')[-1]
|
92 |
|
93 |
# validate the oauth token
|
|
|
86 |
|
87 |
|
88 |
def process_model(ft_model_id: str, base_model_id: str, rank: str, private_repo, oauth_token: gr.OAuthToken | None):
|
89 |
+
# validate the oauth token
|
90 |
+
try:
|
91 |
+
whoami(oauth_token.token)
|
92 |
+
except Exception as e:
|
93 |
raise gr.Error("You must be logged in")
|
94 |
+
|
95 |
model_name = ft_model_id.split('/')[-1]
|
96 |
|
97 |
# validate the oauth token
|