Skip to content
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

How to use ‘hf_model’ #457

Open
3 tasks done
abchbx opened this issue Oct 22, 2024 · 3 comments
Open
3 tasks done

How to use ‘hf_model’ #457

abchbx opened this issue Oct 22, 2024 · 3 comments
Assignees
Labels
question Further information is requested

Comments

@abchbx
Copy link

abchbx commented Oct 22, 2024

Before Asking 在提问之前

  • I have read the README carefully. 我已经仔细阅读了 README 上的操作指引。

  • I have pulled the latest code of main branch to run again and the problem still existed. 我已经拉取了主分支上最新的代码,重新运行之后,问题仍不能解决。

Search before asking 先搜索,再提问

  • I have searched the Data-Juicer issues and found no similar questions. 我已经在 issue列表 中搜索但是没有发现类似的问题。

Question

我尝试使用'hf_model',但是失败了,它告诉我下载错误,该如何解决?

  • generate_instruction_mapper:
    hf_model: 'Qwen/Qwen2.5-1.5B-Instruct'
    trust_remote_code: true
    seed_file: '/mnt/workspace/Moemuu/self_cognition.jsonl'
    instruct_num: 100
    enable_vllm: true
    tensor_parallel_size: 4
    max_model_len: 256

错误提示:OSError: We couldn't connect to 'https://huggingface.co' to load this file, couldn't find it in the cached files and it looks like Qwen/Qwen2.5-1.5B-Instruct is not the path to a directory containing a file named config.json.
Checkout your internet connection or see how to run the library in offline mode at 'https://huggingface.co/docs/transformers/installation#offline-mode'.

Additional 额外信息

No response

@abchbx abchbx added the question Further information is requested label Oct 22, 2024
@HYLcool
Copy link
Collaborator

HYLcool commented Oct 31, 2024

@abchbx ,感谢你的关注与使用~

由于该模型来源于huggingface hub,因此在运行该模型时需要从huggingface下载,由于其在外网,因此可能需要科学上网,还请自行查阅相关资料

或者你可以查找huggingface可以访问到的镜像站,从上面手动下载模型后,将hf_model改为本地模型的目录即可

@HYLcool HYLcool self-assigned this Oct 31, 2024
@abchbx
Copy link
Author

abchbx commented Oct 31, 2024

感谢您的回答,但是我设置了镜像站HF-mirror 但是还是无效。如果手动下载的话,参数需要如何填写?

@HYLcool
Copy link
Collaborator

HYLcool commented Oct 31, 2024

感谢您的回答,但是我设置了镜像站HF-mirror 但是还是无效。如果手动下载的话,参数需要如何填写?

例如你下载这个模型到你本地的/root/models/Qwen2.5-1.5B-Instruct目录,只需要将配置文件中hf_model参数替换为该目录的路径即可:

- generate_instruction_mapper:
      hf_model: '/root/models/Qwen2.5-1.5B-Instruct'
      ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants