cmnfriend / o-lora Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
感谢作者优秀的工作!想请教一下关于O-LoRA在更challenging的长序列任务上(large number of tasks)性能表现与PerTaskFT和MTL有差距的原因可能有哪些?期待您的回复!
请问有人遇到过同样的问题吗?明明环境里有datasets这个包,但是一直报这个错误:
Traceback (most recent call last):
File "/home/user/ljl_new/O-LoRA/src/run_uie_lora.py", line 29, in
import datasets
ModuleNotFoundError: No module named 'datasets'
Traceback (most recent call last):
File "/home/user/ljl_new/O-LoRA/src/run_uie_lora.py", line 29, in
import datasets
ModuleNotFoundError: No module named 'datasets'
Great work! This repo is built based on the pretrained T5-large model, but I wonder if it could be adapted to Llama2? And which part of this project should be modified? Thanks a lot!
请问一下CL_Benchmark里面是完整数据集吗,我在其他地方下载的数据集和里面的条目不太一样
FileNotFoundError: [Errno 2] No such file or directory: 'G:/code/O-LoRA-main/O-LoRA-main/logs_and_outputs/order_1/outputs/1-dbpedia/29ec996b8e1ae5297860b8d946af1b38/uie_dataset_lora/default-d0dfd2a00d317be8/2.0.0/c490e7f13dec80785fc335819009163a45c86ae2816040c8d81800108e 7e4374/uie_dataset_lora-train-00000-00000-of-NNNNN.arrow'
raise DatasetGenerationError("An error occurred while generating the dataset") from e
datasets.builder.DatasetGenerationError: An error occurred while generating the dataset
请问下我在运行order_1.sh时在数据集加载出现文件No such file or directory,经检查后发现outputs下有默认创建的文件夹,但是没有自动生成uie_dataset_lora-train-00000-00000-of-NNNNN.arrow导致了报错,请问该如何解决,谢谢
你好,非常感谢您杰出的工作。我在阅读您的code的时候有2点疑惑:
您好,请问一下,关于实验结果的复现,是直接执行给定的scripts里的文件吗,还是需要调整参数?
感谢您对工作,不过还有个小疑问想请教一下,如题,为什么只算lora_A的loss,而不算lora_B的呢
此处
O-LoRA/src/uie_trainer_lora.py
Line 91 in ff73694
由于这边是跟没有梯度的lora(old)来计算正交,那直接在上一步把lora(old)save为pth是不是可以避免修改peft库了
import torch
# 假设 self.model 是你的模型
stacked_params = {}
for name, param in self.model.named_parameters():
if "lora_" in name:
stacked_params[name] = param.data.clone() # 使用 clone() 复制参数并避免共享内存
# 保存堆叠的参数到文件
torch.save(stacked_params, "path/to/stacked_params.pth")
然后在trainer类里面加载
# 初始化一个字典来存储匹配的模块和对应的参数
matched_modules = {} #load pth
for name, param in self.model.named_parameters():
if "lora_A" in name:
# 匹配的模块名称和对应的参数
param_ = matched_modules[name]
orthogonal_loss += torch.abs(torch.mm(param, param_.T)).sum() # [r * dim] * [dim * r]
break # target modules have been matched
大致这个意思
是不是就可以避免修改PEFT代码,方便很多?
I was wondering if there is an typo in lora.py in line 702,
because you once add r_sum
in class Linear
, so I guess there is still an same in parameter in class Linear8bitLt
您好,我想问下在加载PEFTModel之后lora_A的输出维度为什么是0,是在训练lora_new的时候没有让之前的lora输出特征吗,还想请问一下您都在peft的哪些文件上做了修改呢?
比较好奇,但是在文档和论文里又没有找到。User Interface?
如题,支持QLora吗?
感谢您的工作,非常的nice!但还是有几个问题想请教一下:
我还没成功run起代码来,hf被墙很烦,所以这些问题还暂时没有亲手验证,烦请作者帮忙解惑一下啦~
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.