forked from Luxadevi/Ollama-Companion
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v0.1.2-pre5 queued up/downloads, better quantization and conversion h…
…andling
- Loading branch information
1 parent
8d6ccf1
commit ff7905a
Showing
10 changed files
with
69 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# FILESTATUS Complete and tested. Last updated 0.1.2-pre5 | ||
import sys | ||
from huggingface_hub import snapshot_download | ||
from pathlib import Path | ||
|
||
# Simple download script. full_model_name comes in the form of "model_creator/model_name" | ||
full_model_name = sys.argv[1] | ||
model_creator, model_name = full_model_name.split("/") | ||
download_path = Path("llama.cpp/models") / model_name | ||
download_path.mkdir(parents=True, exist_ok=True) | ||
snapshot_download(repo_id=f"{model_creator}/{model_name}", local_dir=str(download_path)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# FILESTATUS Complete and tested. Last updated 0.1.2-pre5 | ||
import sys | ||
from huggingface_hub import HfApi | ||
from requests.exceptions import HTTPError | ||
|
||
# Simple upload script. full_model_name comes in the form of "model_creator/model_name" | ||
token = sys.argv[1] | ||
api = HfApi() | ||
username = api.whoami(token=token)['name'] | ||
repo_id = f"{username}/{sys.argv[2]}" | ||
|
||
# Check if the repository exists, if not create it | ||
try: | ||
api.repo_info(repo_id=repo_id, token=token) | ||
except HTTPError as e: | ||
if e.response.status_code == 404: | ||
api.create_repo(repo_id=repo_id, token=token, repo_type="model") | ||
else: | ||
raise | ||
|
||
# Upload selected files | ||
for file_name in sys.argv[3:]: | ||
api.upload_file(path_or_fileobj=file_name, path_in_repo=file_name, repo_id=repo_id, token=token) |