DAMHelper / repository /repository.py
enricorampazzo's picture
final command line implementation
d005419
raw
history blame
719 Bytes
from pathlib import Path
from repository.intel_npu import IntelNpuRepository
from repository.ollama import OllamaRepository
from repository.repository_abc import Model
def get_repository(implementation: str, model: Model, system_msg: str = None, log_to_file: Path = None):
known_implementations = ["ollama", "intel_npu"]
if not implementation or implementation.lower() not in ["ollama", "intel_npu"]:
raise ValueError(f"Unknown implementation {implementation}. Known implementations: {known_implementations}")
if "ollama" == implementation:
return OllamaRepository(model, system_msg)
if "intel_npu" == implementation:
return IntelNpuRepository(model, system_msg, log_to_file)