MCPcopy Create free account
hub / github.com/ChenWu98/agent-attack / get_model

Function get_model

agent_attack/models/__init__.py:17–29  ·  view source on GitHub ↗
(hub_path: str)

Source from the content-addressed store, hash-verified

15
16
17def get_model(hub_path: str) -> VLM:
18 if "instructblip" in hub_path:
19 return InstructBLIP(hub_path)
20 elif "llava" in hub_path:
21 return LLaVa(hub_path)
22 elif "gpt" in hub_path:
23 return GPT4V(hub_path)
24 elif "gemini" in hub_path:
25 return Gemini(hub_path)
26 elif "claude" in hub_path:
27 return Claude(hub_path)
28 else:
29 raise ValueError(f"Model {hub_path} not supported.")
30
31
32def get_captioning_model(hub_path: str) -> VLM:

Callers 4

bim.pyFile · 0.90
pgd.pyFile · 0.90
runFunction · 0.90
runFunction · 0.90

Calls 5

InstructBLIPClass · 0.85
LLaVaClass · 0.85
GPT4VClass · 0.85
GeminiClass · 0.85
ClaudeClass · 0.85

Tested by

no test coverage detected