Skip to content

Commit 7b7b824

Browse files
committed
llama2 modelfile creation bug fixed
1 parent 4dc0225 commit 7b7b824

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

get_models.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import ollama
22
import yaml
33
from ollama import delete
4+
import sys
45

5-
def check_and_pull_models(model_option=0):
6+
def check_and_pull_models(model_option:int = 0):
67
"""
78
This function checks for Ollama models based on the provided integer parameter.
89
@@ -14,12 +15,12 @@ def check_and_pull_models(model_option=0):
1415

1516
models_to_check = ["gemma:2b", "tinyllama:latest", "llava:latest"]
1617
if model_option == 1:
17-
models_to_check.append()
18+
models_to_check.append("llama2-uncensored:latest")
1819
models = ollama.list()
1920
available_models = {model["name"]: model for model in models["models"]}
2021
model_list = list(available_models.keys())
21-
models_to_pull = set(models_to_check) - set(model_list)
22-
22+
models_to_pull = set(models_to_check) - set(model_list)
23+
2324
if models_to_pull:
2425
print("Models to pull:")
2526
for model_name in models_to_pull:
@@ -44,7 +45,7 @@ def create_knowly_models(models_list):
4445
ollama.create(model="KnowlyTinyLlama",path="./modelfiles/tinyllama/Modelfile")
4546
elif "llava" in model:
4647
ollama.create(model="KnowlyLlava",path="./modelfiles/llava/Modelfile")
47-
else:
48+
elif "llama2" in model:
4849
ollama.create(model="KnowlyLlama2",path="./modelfiles/llama2/Modelfile")
4950

5051
print("Model finetuning complete.")
@@ -71,4 +72,5 @@ def delete_ollama_model(model_name: str) -> None:
7172

7273

7374
if __name__ == "__main__":
74-
check_and_pull_models()
75+
n = int(sys.argv[-1])
76+
check_and_pull_models(model_option=n)

modelfiles/llama2/Modelfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM llama2:uncensored
1+
FROM llama2-uncensored:latest
22
PARAMETER temperature 1
33
PARAMETER stop [INST]
44
PARAMETER stop [/INST]

0 commit comments

Comments
 (0)