Skip to content

fix: prevent HuggingFace access when SGLANG_USE_MODELSCOPE is enabled#8286

Closed
yankay wants to merge 1 commit intosgl-project:mainfrom
yankay:fix-MODELSCOPE
Closed

fix: prevent HuggingFace access when SGLANG_USE_MODELSCOPE is enabled#8286
yankay wants to merge 1 commit intosgl-project:mainfrom
yankay:fix-MODELSCOPE

Conversation

@yankay
Copy link
Contributor

@yankay yankay commented Jul 23, 2025

Motivation

When SGLANG_USE_MODELSCOPE=true is set, the system was still making calls to HuggingFace endpoints during model configuration loading, which could lead to:

  • Network access issues in environments where HuggingFace is blocked

Fix: #8275

Modifications

Referenced Vllm: vllm-project/vllm#5233
This PR fixes the issue by adding conditional import logic for AutoConfig and HfApi.

The problem can be reliably reproduced by setting HF_ENDPOINT: https://127.0.0.1, so a test case has been modified to ensure no HuggingFace access occurs when SGLANG_USE_MODELSCOPE is enabled.

Checklist

@gemini-code-assist
Copy link
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@yankay
Copy link
Contributor Author

yankay commented Jul 24, 2025

HI @merrymercy
Would you please help to review it :-)

@Vigilans
Copy link

Vigilans commented Sep 1, 2025

Ping for a review.

@yankay
Copy link
Contributor Author

yankay commented Dec 2, 2025

HI @Fridge003 and @Kangyan-Zhou

Could you please help review it again?

@yankay
Copy link
Contributor Author

yankay commented Dec 10, 2025

close because of #12039 merged

@yankay yankay closed this Dec 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

i was set SGLANG_USE_MODELSCOPE=true bug also download model from huggingface

2 participants