mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2025-01-12 13:27:38 +01:00
Add support for downloading ggml files
This commit is contained in:
parent
3a47a602a3
commit
6a44f4aec6
@ -97,6 +97,7 @@ def get_download_links_from_huggingface(model, branch):
|
|||||||
classifications = []
|
classifications = []
|
||||||
has_pytorch = False
|
has_pytorch = False
|
||||||
has_pt = False
|
has_pt = False
|
||||||
|
has_ggml = False
|
||||||
has_safetensors = False
|
has_safetensors = False
|
||||||
is_lora = False
|
is_lora = False
|
||||||
while True:
|
while True:
|
||||||
@ -114,6 +115,7 @@ def get_download_links_from_huggingface(model, branch):
|
|||||||
is_pytorch = re.match("(pytorch|adapter)_model.*\.bin", fname)
|
is_pytorch = re.match("(pytorch|adapter)_model.*\.bin", fname)
|
||||||
is_safetensors = re.match(".*\.safetensors", fname)
|
is_safetensors = re.match(".*\.safetensors", fname)
|
||||||
is_pt = re.match(".*\.pt", fname)
|
is_pt = re.match(".*\.pt", fname)
|
||||||
|
is_ggml = re.match(".*\.bin", fname)
|
||||||
is_tokenizer = re.match("tokenizer.*\.model", fname)
|
is_tokenizer = re.match("tokenizer.*\.model", fname)
|
||||||
is_text = re.match(".*\.(txt|json|py|md)", fname) or is_tokenizer
|
is_text = re.match(".*\.(txt|json|py|md)", fname) or is_tokenizer
|
||||||
|
|
||||||
@ -135,6 +137,9 @@ def get_download_links_from_huggingface(model, branch):
|
|||||||
elif is_pt:
|
elif is_pt:
|
||||||
has_pt = True
|
has_pt = True
|
||||||
classifications.append('pt')
|
classifications.append('pt')
|
||||||
|
elif is_ggml:
|
||||||
|
has_ggml = True
|
||||||
|
classifications.append('ggml')
|
||||||
|
|
||||||
cursor = base64.b64encode(f'{{"file_name":"{dict[-1]["path"]}"}}'.encode()) + b':50'
|
cursor = base64.b64encode(f'{{"file_name":"{dict[-1]["path"]}"}}'.encode()) + b':50'
|
||||||
cursor = base64.b64encode(cursor)
|
cursor = base64.b64encode(cursor)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user