throw error if got adapter with added_tokens#18046
throw error if got adapter with added_tokens#18046Fridge003 merged 1 commit intosgl-project:mainfrom
Conversation
Summary of ChangesHello @glenliu21, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a temporary safeguard to prevent the loading of LoRA adapters that modify the vocabulary, which is not yet fully supported. Concurrently, it significantly refactors and simplifies the internal logic for loading LoRA adapters, making the process more unified and robust for future enhancements. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a check to prevent loading LoRA adapters with added tokens, which is a sensible guard for a feature not yet fully supported. The accompanying refactoring of the adapter loading logic is well-executed. By consolidating the loading from a path and from tensors into a single load_lora_adapter method, the code is now cleaner, more maintainable, and has less duplication. The introduction of the LoRATensorPayload dataclass is a good way to structure the data passed for loading from tensors. Overall, the changes are solid and improve the codebase.
|
@glenliu21 Can you please split the logic of refactors into another PR |
Opened #18288 for this. |
e5ce4e0 to
b9a323a
Compare
|
/tag-and-rerun-ci |
PR #18046 added validation rejecting LoRA adapters with added_tokens.json, but the test adapter y9760210/Qwen3-4B-lora_model has added_tokens.json, causing a server crash (exit code -9). Replace with TanXS/Qwen3-4B-LoRA-ZH-WebNovelty-v0.0 which is a valid Qwen3-4B LoRA adapter without added_tokens.json. Failure: https://github.com/sgl-project/sglang/actions/runs/22026980777/job/63645203194
Motivation
Before supporting loading adapters with added tokens in #17794, we should disable that functionality for now.
Modifications
Checklist
Review Process
/tag-run-ci-label,/rerun-failed-ci,/tag-and-rerun-ci