multimodalart HF staff commited on
Commit
c1a469b
1 Parent(s): 8b0aa74

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -250,13 +250,13 @@ def check_civit_link(profile: Optional[gr.OAuthProfile], url):
250
  hf_username = extract_huggingface_username(info['creator'])
251
  attributes_methods = dir(profile)
252
 
253
- if(profile.preferred_username == "multimodalart"):
254
  return '', gr.update(interactive=True), gr.update(visible=False), gr.update(visible=True)
255
 
256
  if(not hf_username):
257
  no_username_text = f'If you are {info["creator"]} on CivitAI, hi! Your CivitAI profile seems to not have information about your Hugging Face account. Please visit <a href="https://civitai.com/user/account" target="_blank">https://civitai.com/user/account</a> and include your 🤗 username there, here\'s mine:<br><img width="60%" src="https://i.imgur.com/hCbo9uL.png" /><br>(if you are not {info["creator"]}, you cannot submit their model at this time)'
258
  return no_username_text, gr.update(interactive=False), gr.update(visible=True), gr.update(visible=False)
259
- if(profile.preferred_username != hf_username):
260
  unmatched_username_text = '<h4>Oops, the Hugging Face account in your CivitAI profile seems to be different than the one your are using here. Please visit <a href="https://civitai.com/user/account">https://civitai.com/user/account</a> and update it there to match your Hugging Face account<br><img src="https://i.imgur.com/hCbo9uL.png" /></h4>'
261
  return unmatched_username_text, gr.update(interactive=False), gr.update(visible=True), gr.update(visible=False)
262
  else:
@@ -304,7 +304,7 @@ def upload_civit_to_hf(profile: Optional[gr.OAuthProfile], oauth_token: gr.OAuth
304
  slug_name = slugify(info["name"])
305
  except:
306
  raise gr.Error("logging into hf went wrong")
307
- user_repo_id = f"{profile.preferred_username}/{slug_name}"
308
  create_readme(info, downloaded_files, user_repo_id, link_civit, folder=folder)
309
  try:
310
  #repo_id = f"{username}/{profile.preferred_username}-{slug_name}"
 
250
  hf_username = extract_huggingface_username(info['creator'])
251
  attributes_methods = dir(profile)
252
 
253
+ if(profile.username == "multimodalart"):
254
  return '', gr.update(interactive=True), gr.update(visible=False), gr.update(visible=True)
255
 
256
  if(not hf_username):
257
  no_username_text = f'If you are {info["creator"]} on CivitAI, hi! Your CivitAI profile seems to not have information about your Hugging Face account. Please visit <a href="https://civitai.com/user/account" target="_blank">https://civitai.com/user/account</a> and include your 🤗 username there, here\'s mine:<br><img width="60%" src="https://i.imgur.com/hCbo9uL.png" /><br>(if you are not {info["creator"]}, you cannot submit their model at this time)'
258
  return no_username_text, gr.update(interactive=False), gr.update(visible=True), gr.update(visible=False)
259
+ if(profile.username != hf_username):
260
  unmatched_username_text = '<h4>Oops, the Hugging Face account in your CivitAI profile seems to be different than the one your are using here. Please visit <a href="https://civitai.com/user/account">https://civitai.com/user/account</a> and update it there to match your Hugging Face account<br><img src="https://i.imgur.com/hCbo9uL.png" /></h4>'
261
  return unmatched_username_text, gr.update(interactive=False), gr.update(visible=True), gr.update(visible=False)
262
  else:
 
304
  slug_name = slugify(info["name"])
305
  except:
306
  raise gr.Error("logging into hf went wrong")
307
+ user_repo_id = f"{profile.username}/{slug_name}"
308
  create_readme(info, downloaded_files, user_repo_id, link_civit, folder=folder)
309
  try:
310
  #repo_id = f"{username}/{profile.preferred_username}-{slug_name}"