ChenoAi commited on
Commit
e054cf7
Β·
verified Β·
1 Parent(s): 0f53168

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -11
app.py CHANGED
@@ -71,19 +71,10 @@ def upload_model(source_url, dst_repo, token,civitai_api_key, new_name, dst_repo
71
  )
72
 
73
  except Exception as e:
74
- # Handle exceptions and provide an error message
75
- blames = ["grandma", "my boss", "your boss", "God", "you", "you. It's *all* your fault.", "the pope"]
76
- blameweights = (1, 1, 1, 1, 4, 2, 1)
77
- excuses = ["I blame it all on " + random.choices(blames, weights=blameweights)[0], "It's my fault, sorry.",
78
- "I did it on purpose.", "That file doesn't want to be downloaded.", "You nincompoop!"]
79
- excusesweights = (12, 1, 1, 2, 3)
80
- excuse = random.choices(excuses, weights=excusesweights)[0]
81
  return (
82
  f"""
83
  ### Error 😒😒😒
84
- {e}
85
- <i>""" + excuse + "</i>",
86
- None,
87
  )
88
 
89
  # Interface setup
@@ -107,4 +98,8 @@ interface = gr.Interface(
107
  article="<p>Find your write token at <a href='https://huggingface.co/settings/tokens' target='_blank'>token settings</a></p>",
108
  allow_flagging="never",
109
  live=False, # Prevents automatic re-runs on input change
110
- )
 
 
 
 
 
71
  )
72
 
73
  except Exception as e:
 
 
 
 
 
 
 
74
  return (
75
  f"""
76
  ### Error 😒😒😒
77
+ {e}"""
 
 
78
  )
79
 
80
  # Interface setup
 
98
  article="<p>Find your write token at <a href='https://huggingface.co/settings/tokens' target='_blank'>token settings</a></p>",
99
  allow_flagging="never",
100
  live=False, # Prevents automatic re-runs on input change
101
+ )
102
+
103
+
104
+
105
+ interface.launch()