Skip to content

Fix model mapping issues and download resumption for HuggingFace models#903

Merged
wzh1994 merged 2 commits intoLazyAGI:mainfrom
JingofXin:sxy/download_model
Dec 19, 2025
Merged

Fix model mapping issues and download resumption for HuggingFace models#903
wzh1994 merged 2 commits intoLazyAGI:mainfrom
JingofXin:sxy/download_model

Conversation

@JingofXin
Copy link
Collaborator

📌 PR 内容 / PR Description

Fixed #839:

Wrong model mapping URLs like "stabilityai/stable-diffusion-3-medium"

Some Huggingface models require a token configuration, which can be done via: os.environ['LAZYLLM_MODEL_SOURCE_TOKEN'] = 'hf_ZBoxxxxxxx' (this needs to be done before importing lazyllm). If not configured, we've added a clearer error message
企业微信截图_17660434312637

Wrong model names in official tutorial like "musicgen-small"

Fixed and added model mappings.

Builtin models are not working out of the box, like "internlm2-chat-7b-4bits"

Some examples are provided.

Cannot continue from interrupted model downloads

Fixed and removed the logic that would clear the data if the download was interrupted or failed.

🔍 相关 Issue / Related Issue

Fix #839

✅ 变更类型 / Type of Change

  • 修复 Bug / Bug fix (non-breaking change that fixes an issue)
  • 新功能 / New feature (non-breaking change that adds functionality)
  • 重构 / Refactor (no functionality change, code structure optimized)
  • 重大变更 / Breaking change (fix or feature that would cause existing functionality to change)
  • 文档更新 / Documentation update (changes to docs only)
  • 性能优化 / Performance optimization

🧪 如何测试 / How Has This Been Tested?

import os
os.environ['HF_ENDPOINT']="https://hf-mirror.com"
os.environ['LAZYLLM_MODEL_SOURCE'] = 'huggingface'
os.environ['LAZYLLM_MODEL_SOURCE_TOKEN'] = 'hf_ZBoOcccccccccxxxxxxxxxx'

import lazyllm
base = lazyllm.TrainableModule('stabilityai/stable-diffusion-3-medium')

Demo Use: internlm2-chat-7b-4bits
(1) vLLM

import lazyllm
chat = lazyllm.TrainableModule('internlm2-chat-7b-4bits').deploy_method(
    (lazyllm.deploy.vllm, {'max_model_len': 8192}))
chat.start()
res = chat("写一个关于春天的诗歌。")
print(res)

(2) LMdeploy

import lazyllm
chat = lazyllm.TrainableModule('internlm2-chat-7b-4bits').deploy_method(lazyllm.deploy.LMDeploy)
chat.start()
res = chat("写一个关于春天的诗歌。", stop='<|im_end|>')
print(res)

📷 截图 / Demo (Optional)

企业微信截图_17660571975766 企业微信截图_17660573822919

@wzh1994 wzh1994 merged commit 1b59db8 into LazyAGI:main Dec 19, 2025
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

General usage problem

2 participants