wangyuxinwhy / uniem

unified embedding model

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

关于数据集 是否已经添加过了?

Galaxy-Ding opened this issue · comments

dataset name

cMedQA

huggingface dataset id

https://github.com/zhangsheng93/cMedQA

task type

None

dataset description

作者您好
我这边想试试 m3e 的微调效果,因此想问下这个数据集,您是否加进去训练了?

如果没有的,我先拿下来训练,看效果是否可以的

没有使用这个数据集,所有使用的数据集列表在 这里

不过我收集数据集的时候看到过这个,但是忘记为啥没有收录进来了.... 你微调试试看,看看效果怎么样~

uniem 3.0 版本的 FineTuner 的 api 有变化,请参考下面的代码,或者 colab 教程

from datasets import load_dataset

from uniem.finetuner import FineTuner

dataset = load_dataset('shibing624/nli_zh', 'STS-B')
# 注意下面这一行
finetuner = FineTuner.from_pretrained('moka-ai/m3e-small', dataset=dataset)
finetuner.run(epochs=3)

谢谢,试下。

keyi 可以提供微调环境的requirement
经常报错。。

可以参考这个教程 https://colab.research.google.com/github/wangyuxinwhy/uniem/blob/main/examples/finetune.ipynb

在本地的话,可以参考下面的流程

  1. 创建虚拟环境
conda create -n uniem python=3.10
  1. 安装 uniem
pip install uniem
  1. 开始微调

可以参考这个教程 https://colab.research.google.com/github/wangyuxinwhy/uniem/blob/main/examples/finetune.ipynb

在本地的话,可以参考下面的流程

  1. 创建虚拟环境
conda create -n uniem python=3.10
  1. 安装 uniem
pip install uniem
  1. 开始微调

奇怪了,一开始报错是需要pythin3.10,重新建虚拟环境,
又给报错是toolkits 113,没引用,后来,就先装torch1.10.1-cu113
再装uiem的包,
这次有显示
ImportError: cannot import name 'LRScheduler' from 'torch.optim.lr_scheduler
因此,想要问问实际的包都装了那些

抱歉,可能我提示做的不够好。

ImportError: cannot import name 'LRScheduler' from 'torch.optim.lr_scheduler

这个是由于你的 torch 是 1.10.1 造成的,uniem 需要 torch 2.0 的环境。uniem 的代码比较新,所以依赖的选择都比较激进,我应该尝试兼容更多的版本。

你可以查看 https://github.com/wangyuxinwhy/uniem/blob/main/pyproject.toml

uniem 安装了如下依赖:
python = "^3.10"
transformers = "^4.28.0"
accelerate = "^0.19.0"
tqdm = "^4.65.0"
typer = {extras = ["all"], version = "^0.9.0"}
datasets = "^2.12.0"

uniem 0.3.1 已经支持 torch 1.0 的版本了

运行如下命令可以更新 uniem

pip install -U uniem 

haode好的 我先看看