File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -14,17 +14,22 @@ def get_model() -> str:
14
14
model_url = "https://huggingface.co/Sosaka/Alpaca-native-4bit-ggml/resolve/main/ggml-alpaca-7b-q4.bin"
15
15
tokenizer_url = "https://huggingface.co/decapoda-research/llama-7b-hf/resolve/main/tokenizer.model"
16
16
conversion_script = "https://github.com/ggerganov/llama.cpp/raw/master/convert-unversioned-ggml-to-ggml.py"
17
+ migrate_script = "https://github.com/ggerganov/llama.cpp/raw/master/migrate-ggml-2023-03-30-pr613.py"
17
18
local_filename = model_url .split ("/" )[- 1 ]
19
+ local_filename_ggjt = local_filename .split ('.' )[0 ] + '-ggjt.' + local_filename .split ('.' )[1 ]
18
20
19
21
if not os .path .exists ("convert-unversioned-ggml-to-ggml.py" ):
20
22
urlretrieve (conversion_script , "convert-unversioned-ggml-to-ggml.py" )
23
+ if not os .path .exists ("migrate-ggml-2023-03-30-pr613.py" ):
24
+ urlretrieve (migrate_script , "migrate-ggml-2023-03-30-pr613.py" )
21
25
if not os .path .exists ("tokenizer.model" ):
22
26
urlretrieve (tokenizer_url , "tokenizer.model" )
23
27
if not os .path .exists (local_filename ):
24
28
urlretrieve (model_url , local_filename )
25
- os .system ("python convert-unversioned-ggml-to-ggml.py . tokenizer.model" )
29
+ os .system (f"python convert-unversioned-ggml-to-ggml.py . tokenizer.model" )
30
+ os .system (f"python migrate-ggml-2023-03-30-pr613.py { local_filename } { local_filename_ggjt } " )
26
31
27
- return local_filename
32
+ return local_filename_ggjt
28
33
29
34
30
35
def test_llamacpp_embedding_documents () -> None :
Original file line number Diff line number Diff line change @@ -13,17 +13,22 @@ def get_model() -> str:
13
13
model_url = "https://huggingface.co/Sosaka/Alpaca-native-4bit-ggml/resolve/main/ggml-alpaca-7b-q4.bin"
14
14
tokenizer_url = "https://huggingface.co/decapoda-research/llama-7b-hf/resolve/main/tokenizer.model"
15
15
conversion_script = "https://github.com/ggerganov/llama.cpp/raw/master/convert-unversioned-ggml-to-ggml.py"
16
+ migrate_script = "https://github.com/ggerganov/llama.cpp/raw/master/migrate-ggml-2023-03-30-pr613.py"
16
17
local_filename = model_url .split ("/" )[- 1 ]
18
+ local_filename_ggjt = local_filename .split ('.' )[0 ] + '-ggjt.' + local_filename .split ('.' )[1 ]
17
19
18
20
if not os .path .exists ("convert-unversioned-ggml-to-ggml.py" ):
19
21
urlretrieve (conversion_script , "convert-unversioned-ggml-to-ggml.py" )
22
+ if not os .path .exists ("migrate-ggml-2023-03-30-pr613.py" ):
23
+ urlretrieve (migrate_script , "migrate-ggml-2023-03-30-pr613.py" )
20
24
if not os .path .exists ("tokenizer.model" ):
21
25
urlretrieve (tokenizer_url , "tokenizer.model" )
22
26
if not os .path .exists (local_filename ):
23
27
urlretrieve (model_url , local_filename )
24
28
os .system (f"python convert-unversioned-ggml-to-ggml.py . tokenizer.model" )
29
+ os .system (f"python migrate-ggml-2023-03-30-pr613.py { local_filename } { local_filename_ggjt } " )
25
30
26
- return local_filename
31
+ return local_filename_ggjt
27
32
28
33
29
34
def test_llamacpp_inference () -> None :
You can’t perform that action at this time.
0 commit comments