Skip to content

Commit

Permalink
update name
Browse files Browse the repository at this point in the history
Signed-off-by: Ashwin Vaidya <ashwinnitinvaidya@gmail.com>
  • Loading branch information
ashwinvaidya17 committed Oct 16, 2024
1 parent 8ec8e6e commit 151759e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/anomalib/models/image/vlm_ad/lightning_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ def __init__(
self.vlm_backend: Backend = self._setup_vlm_backend(model, api_key)

@staticmethod
def _setup_vlm_backend(model: ModelName, api_key: str | None) -> Backend:
if model == ModelName.LLAMA_OLLAMA:
return Ollama(model_name=model.value)
if model == ModelName.GPT_4O_MINI:
return ChatGPT(api_key=api_key, model_name=model.value)
if model in {ModelName.VICUNA_7B_HF, ModelName.VICUNA_13B_HF, ModelName.MISTRAL_7B_HF}:
return Huggingface(model_name=model.value)

msg = f"Unsupported VLM model: {model}"
def _setup_vlm_backend(model_name: ModelName, api_key: str | None) -> Backend:
if model_name == ModelName.LLAMA_OLLAMA:
return Ollama(model_name=model_name.value)
if model_name == ModelName.GPT_4O_MINI:
return ChatGPT(api_key=api_key, model_name=model_name.value)
if model_name in {ModelName.VICUNA_7B_HF, ModelName.VICUNA_13B_HF, ModelName.MISTRAL_7B_HF}:
return Huggingface(model_name=model_name.value)

Check warning on line 41 in src/anomalib/models/image/vlm_ad/lightning_model.py

View check run for this annotation

Codecov / codecov/patch

src/anomalib/models/image/vlm_ad/lightning_model.py#L38-L41

Added lines #L38 - L41 were not covered by tests

msg = f"Unsupported VLM model: {model_name}"

Check warning on line 43 in src/anomalib/models/image/vlm_ad/lightning_model.py

View check run for this annotation

Codecov / codecov/patch

src/anomalib/models/image/vlm_ad/lightning_model.py#L43

Added line #L43 was not covered by tests
raise ValueError(msg)

def _setup(self) -> None:
Expand Down

0 comments on commit 151759e

Please sign in to comment.