ngxson HF staff commited on
Commit
e5b7e55
·
verified ·
1 Parent(s): 114dc33

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -15,11 +15,11 @@ from apscheduler.schedulers.background import BackgroundScheduler
15
  CONVERSION_SCRIPT = "convert_lora_to_gguf.py"
16
 
17
  def process_model(peft_model_id: str, base_model_id: str, q_method: str, private_repo, oauth_token: gr.OAuthToken | None):
18
- if oauth_token is None or oauth_token.token is None:
19
- raise gr.Error("You must be logged in to use GGUF-my-lora")
20
-
21
  # validate the oauth token
22
- whoami(oauth_token.token)
 
 
 
23
 
24
  model_name = peft_model_id.split('/')[-1]
25
  gguf_output_name = f"{model_name}-{q_method.lower()}.gguf"
 
15
  CONVERSION_SCRIPT = "convert_lora_to_gguf.py"
16
 
17
  def process_model(peft_model_id: str, base_model_id: str, q_method: str, private_repo, oauth_token: gr.OAuthToken | None):
 
 
 
18
  # validate the oauth token
19
+ try:
20
+ whoami(oauth_token.token)
21
+ except Exception as e:
22
+ raise gr.Error("You must be logged in to use GGUF-my-lora")
23
 
24
  model_name = peft_model_id.split('/')[-1]
25
  gguf_output_name = f"{model_name}-{q_method.lower()}.gguf"