Spaces:
Runtime error
Runtime error
testbot
commited on
Commit
·
a4ab7ed
1
Parent(s):
85aa03c
use create_commit
Browse files
app.py
CHANGED
|
@@ -2,7 +2,7 @@ from pathlib import Path
|
|
| 2 |
from tempfile import TemporaryDirectory
|
| 3 |
|
| 4 |
import gradio as gr
|
| 5 |
-
from huggingface_hub import
|
| 6 |
from huggingface_hub.utils import RepositoryNotFoundError
|
| 7 |
|
| 8 |
from convert import convert
|
|
@@ -43,10 +43,13 @@ def run(
|
|
| 43 |
)
|
| 44 |
print("[model_path]", model_path)
|
| 45 |
|
| 46 |
-
commit_info = api.
|
| 47 |
repo_id=destination,
|
| 48 |
-
|
| 49 |
-
|
|
|
|
|
|
|
|
|
|
| 50 |
create_pr=True,
|
| 51 |
commit_message=f"Add {model_path.name} from bloomz.cpp converter.",
|
| 52 |
)
|
|
|
|
| 2 |
from tempfile import TemporaryDirectory
|
| 3 |
|
| 4 |
import gradio as gr
|
| 5 |
+
from huggingface_hub import CommitOperationAdd, HfApi
|
| 6 |
from huggingface_hub.utils import RepositoryNotFoundError
|
| 7 |
|
| 8 |
from convert import convert
|
|
|
|
| 43 |
)
|
| 44 |
print("[model_path]", model_path)
|
| 45 |
|
| 46 |
+
commit_info = api.create_commit(
|
| 47 |
repo_id=destination,
|
| 48 |
+
operations=[
|
| 49 |
+
CommitOperationAdd(
|
| 50 |
+
path_or_fileobj=model_path, path_in_repo=model_path.name
|
| 51 |
+
)
|
| 52 |
+
],
|
| 53 |
create_pr=True,
|
| 54 |
commit_message=f"Add {model_path.name} from bloomz.cpp converter.",
|
| 55 |
)
|