Conversation
There was a problem hiding this comment.
Pull request overview
Updates the project’s example notebooks to make ModelScope authentication and checkpoint publishing workflows clearer and safer for interactive use, aligning them with the current Twinkle client APIs.
Changes:
- Prompt for ModelScope token via
getpass()and wire it into Twinkle/Tinker clients (instead ofos.environ.get(...)). - Add “upload checkpoint to ModelScope Hub” example snippets using
MultiLoraTransformersModel.upload_to_hub(...). - Refresh notebook hygiene/UX (clear some outputs, set execution counts to
null, add MoE compatibility notes, update notebook metadata).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| notebook/short_math_grpo.ipynb | Switches auth to interactive token input; adds an upload-to-hub example cell; clears outputs/execution counts. |
| notebook/self_cognition.ipynb | Adds interactive token input, MoE note, upload-to-hub snippet, and metadata updates. |
| notebook/sample.ipynb | Switches auth to interactive token input for sampling example. |
| notebook/multi_modal.ipynb | Switches auth to interactive token input; adds upload-to-hub snippet; adds MoE note and metadata updates. |
| notebook/dpo.ipynb | Switches auth to interactive token input; adds explicit save + upload-to-hub snippet; adds MoE note and metadata updates. |
There was a problem hiding this comment.
Code Review
This pull request updates several Jupyter notebooks to improve security and usability by replacing environment-based API key retrieval with interactive getpass prompts and adding explicit logic for saving and uploading LoRA checkpoints to the ModelScope Hub. It also introduces warnings regarding MoE model compatibility and updates notebook metadata. The review feedback identifies opportunities to improve code cleanliness by removing redundant client and model initializations in the upload sections and suggests using generic placeholders for repository IDs instead of hardcoded user strings to ensure consistency across the examples.
* update * update * update (cherry picked from commit 7e3b00b)
PR type
PR information
Write the detail information belongs to this PR.
Experiment results
Paste your experiment result here(if needed).