devingulliver
commited on
Commit
•
2bd6997
1
Parent(s):
f374e7e
Update app.py
Browse files
app.py
CHANGED
@@ -7,22 +7,22 @@ webhook_url = os.environ.get("WEBHOOK_URL")
|
|
7 |
|
8 |
def submit_model(name):
|
9 |
#try:
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
except RepositoryNotFoundError:
|
15 |
-
|
16 |
-
except:
|
17 |
-
|
18 |
-
|
19 |
#try:
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
except:
|
25 |
-
|
26 |
|
27 |
return "# SUCCESS: Please wait up to 24 hours for your model to be added to the queue."
|
28 |
|
|
|
7 |
|
8 |
def submit_model(name):
|
9 |
#try:
|
10 |
+
print(name)
|
11 |
+
hf_hub_download(repo_id=name, filename="config.json") # sanity check input
|
12 |
+
#except EntryNotFoundError:
|
13 |
+
# return "# ERROR: Model does not have a config.json file!"
|
14 |
+
#except RepositoryNotFoundError:
|
15 |
+
# return "# ERROR: Model could not be found on the Hugging Face Hub!"
|
16 |
+
#except:
|
17 |
+
# return "# ERROR: Unexpected error. Please try again later."
|
18 |
+
#
|
19 |
#try:
|
20 |
+
result = requests.post(webhook_url, json={"content":name})
|
21 |
+
#result.raise_for_status()
|
22 |
+
#except requests.exceptions.HTTPError:
|
23 |
+
# return "# ERROR: Could not contact queue. Please try again in a few minutes."
|
24 |
+
#except:
|
25 |
+
# return "# ERROR: Unexpected error. Please try again later."
|
26 |
|
27 |
return "# SUCCESS: Please wait up to 24 hours for your model to be added to the queue."
|
28 |
|