Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: model_id format for ollama to use local models #49

Merged
merged 1 commit into from Mar 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/llm/llm.py
Expand Up @@ -19,8 +19,8 @@ class Model(Enum):
GPT_3_5 = ("GPT-3.5", "gpt-3.5-turbo-0125")
OLLAMA_MODELS = [
(
model["name"].split(":")[0],
model["name"],
f"{model['details']['parameter_size']} - {model['details']['quantization_level']}",
)
for model in Ollama.list_models()
]
Expand All @@ -36,7 +36,7 @@ def list_models(self) -> list[tuple[str, str]]:

def model_id_to_enum_mapping(self):
models = {model.value[1]: model for model in Model if model.name != "OLLAMA_MODELS"}
ollama_models = {model[0]: "OLLAMA_MODELS" for model in Model.OLLAMA_MODELS.value}
ollama_models = {model[1]: "OLLAMA_MODELS" for model in Model.OLLAMA_MODELS.value}
models.update(ollama_models)
return models

Expand Down