(
self, clip_model_path: str, verbose: bool = True, use_gpu: bool = True
)
| 3268 | |
| 3269 | class MTMDChatHandler: |
| 3270 | def __init__( |
| 3271 | self, clip_model_path: str, verbose: bool = True, use_gpu: bool = True |
| 3272 | ): |
| 3273 | import llama_cpp.mtmd_cpp as mtmd_cpp |
| 3274 | |
| 3275 | self.clip_model_path = clip_model_path |
| 3276 | self.verbose = verbose |
| 3277 | self.use_gpu = use_gpu |
| 3278 | self._mtmd_cpp = mtmd_cpp |
| 3279 | self._exit_stack = ExitStack() |
| 3280 | self.mtmd_ctx: Optional[mtmd_cpp.mtmd_context_p] = None |
| 3281 | |
| 3282 | if not os.path.exists(clip_model_path): |
| 3283 | raise ValueError(f"Clip model path does not exist: {clip_model_path}") |
| 3284 | |
| 3285 | def _init_mtmd_context(self, llama_model: llama.Llama): |
| 3286 | self.verbose = llama_model.verbose |
nothing calls this directly
no outgoing calls
no test coverage detected