[Bugfix]Fix MiniCPM's LoRA bug (#9286)

This commit is contained in:
Jee Jee Li
2024-10-12 09:36:47 -07:00
committed by GitHub
parent 2b184ddd4f
commit 250e26a63e
3 changed files with 40 additions and 17 deletions
+5 -1
View File
@@ -337,7 +337,11 @@ class LoRAModelManager(AdapterModelManager):
self.packed_modules_mapping = copy.deepcopy(
self.model.packed_modules_mapping)
# Used to indicate whether the model is a multimodal model
self.supports_mm: bool = supports_multimodal(self.model)
self.supports_mm: bool = (
supports_multimodal(self.model)
# In case the model only supports LoRA for
# text modules (e.g. ChatGLM)
and hasattr(self.model, "get_mm_mapping"))
self.packed_modules: Dict[str, List[str]] = {}
self.modules: Dict[str, "BaseLayerWithLoRA"] = {}
# Dict instead of a Set for compatibility with LRUCache.