-
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.
feat: allow ChatLlamaCpp offline use
- Loading branch information
Showing
5 changed files
with
43 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,3 @@ | |
DEFAULT_QUANT_SMALL = "*Q2_K.gguf" | ||
DEFAULT_TEMPERATURE = 0.0 | ||
DEFAULT_MAX_RETRIES = 8 | ||
a |
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,15 @@ | ||
import glob | ||
import os | ||
|
||
|
||
def find_file(path: str, filename_pattern: str): | ||
""" | ||
Find a file with the pattern below the given path. | ||
Return the first occurrence if there are multiple matches. | ||
Returns: | ||
str: The path to the first matching file, or None if no file is found. | ||
""" | ||
search_pattern = os.path.join(path, "**", filename_pattern) | ||
matching_files = glob.glob(search_pattern, recursive=True) | ||
return matching_files[0] if matching_files else None |
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,5 @@ | ||
import os | ||
|
||
|
||
def hf_home(): | ||
return os.getenv('HF_HOME', os.path.join(os.path.expanduser("~"), ".cache", "huggingface")) |
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