Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Felix Marty
commited on
Commit
·
8ffc66a
1
Parent(s):
be527a9
add requirement
Browse files- app.py +3 -9
- requirements.txt +1 -0
app.py
CHANGED
|
@@ -31,6 +31,7 @@ def onnx_export(token: str, model_id: str, task: str) -> str:
|
|
| 31 |
commit_info = convert(api=api, model_id=model_id, task=task)
|
| 32 |
print("[commit_info]", commit_info)
|
| 33 |
|
|
|
|
| 34 |
# save in a private dataset:
|
| 35 |
if repo is not None:
|
| 36 |
repo.git_pull(rebase=True)
|
|
@@ -48,17 +49,10 @@ def onnx_export(token: str, model_id: str, task: str) -> str:
|
|
| 48 |
commit_url = repo.push_to_hub()
|
| 49 |
print("[dataset]", commit_url)
|
| 50 |
|
| 51 |
-
return f""
|
| 52 |
-
### Success 🔥
|
| 53 |
-
Yay! This model was successfully converted and a PR was open using your token, here:
|
| 54 |
-
[{commit_info.pr_url}]({commit_info.pr_url})
|
| 55 |
"""
|
| 56 |
except Exception as e:
|
| 57 |
-
return f""
|
| 58 |
-
### Error 😢😢
|
| 59 |
-
|
| 60 |
-
{e}
|
| 61 |
-
"""
|
| 62 |
|
| 63 |
|
| 64 |
DESCRIPTION = """
|
|
|
|
| 31 |
commit_info = convert(api=api, model_id=model_id, task=task)
|
| 32 |
print("[commit_info]", commit_info)
|
| 33 |
|
| 34 |
+
"""
|
| 35 |
# save in a private dataset:
|
| 36 |
if repo is not None:
|
| 37 |
repo.git_pull(rebase=True)
|
|
|
|
| 49 |
commit_url = repo.push_to_hub()
|
| 50 |
print("[dataset]", commit_url)
|
| 51 |
|
| 52 |
+
return f"### Success 🔥 Yay! This model was successfully converted and a PR was open using your token, here: {commit_info.pr_url}]({commit_info.pr_url})"
|
|
|
|
|
|
|
|
|
|
| 53 |
"""
|
| 54 |
except Exception as e:
|
| 55 |
+
return f"### Error: {e}"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
|
| 57 |
|
| 58 |
DESCRIPTION = """
|
requirements.txt
CHANGED
|
@@ -1,3 +1,4 @@
|
|
| 1 |
torch
|
| 2 |
transformers
|
|
|
|
| 3 |
git+https://github.com/huggingface/optimum.git#egg=optimum[onnxruntime]
|
|
|
|
| 1 |
torch
|
| 2 |
transformers
|
| 3 |
+
huggingface_hub
|
| 4 |
git+https://github.com/huggingface/optimum.git#egg=optimum[onnxruntime]
|