-
Notifications
You must be signed in to change notification settings - Fork 257
【开源实习】- Dora-finetuning模型微调 - #IAN239 #1620
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
mindnlp/peft/tuners/lora/dora.py
Outdated
from mindnlp.peft.utils.integrations import dequantize_module_weight | ||
from ...utils.other import transpose | ||
import mindspore | ||
from mindspore import ops |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
都用mindnlp.core.ops
mindnlp/peft/utils/integrations.py
Outdated
from mindspore import Parameter | ||
from mindnlp.core import ops | ||
|
||
def dequantize_module_weight(module: nn.Module) -> nn.Parameter: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这部分用不到,不用加
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改~
requirements/requirements.txt
Outdated
tiktoken | ||
faiss_cpu | ||
phonemizer | ||
bitsandbytes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
涉及量化的删掉。。。
mindnlp/peft/tuners/lora/dora.py
Outdated
lora_weight = lora_weight.half() | ||
weight_norm = self.get_weight_norm(weight, lora_weight, scaling) | ||
if place_on_cpu: | ||
weight_norm = weight_norm.to("cpu") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pytorch代码?
self._disable_adapters = False | ||
self.merged_adapters = [] | ||
self.use_dora: dict[str, bool] = {} | ||
self.lora_magnitude_vector: Optional[ParameterDict] = None # for DoRA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里为啥改了?
# initialize a the same way as the default for nn.Linear and b to zero | ||
nn.init.zeros_(self.lora_embedding_A[adapter_name]) | ||
nn.init.normal_(self.lora_embedding_B[adapter_name]) | ||
def dora_init(self, adapter_name: str) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
函数之间要加空行
No description provided.