Skip to content

Conversation

@FrankLeeeee
Copy link
Collaborator

@FrankLeeeee FrankLeeeee commented Dec 2, 2025

Motivation

I found that models are downloaded to cache dir as well, however, this might not be the wanted behaviour as models reside in ~/.cache/huggingface often. To reduce repeated downloading, let's have an argument for model cache dir specifically.

Modifications

Related Issues

Accuracy Test

Benchmark & Profiling

Checklist

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @FrankLeeeee, 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 hotfix provides enhanced control over model download locations within the prepare_hidden_states.py and train_eagle3.py scripts. By introducing a dedicated command-line argument, users can now explicitly define where pre-trained models are stored, separating this concern from general caching mechanisms and improving directory organization.

Highlights

  • New Command-Line Argument: Introduced a new command-line argument, --model-download-dir, in both scripts/prepare_hidden_states.py and scripts/train_eagle3.py. This argument allows users to explicitly specify the directory where target models should be downloaded.
  • Model Download Location Control: Updated model loading and configuration functions across both scripts to utilize the newly introduced --model-download-dir argument as the cache_dir. This change ensures that model downloads are directed to the specified location, providing better control over storage.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new --model-download-dir argument to separate the model download location from the general --cache-dir. This is a good improvement for cache management. However, the current implementation changes the default behavior. Previously, models were downloaded to the directory specified by --cache-dir (defaulting to ./cache). With these changes, if --model-download-dir is not provided, it defaults to None, causing transformers to use its default cache (~/.cache/huggingface/hub). This could be an unexpected breaking change for users. My review suggests falling back to args.cache_dir when args.model_download_dir is not set to maintain backward compatibility while still allowing users to specify a separate model download directory.

@FrankLeeeee FrankLeeeee changed the title Hotfix/model download dir added model-download-dir Dec 2, 2025
@FrankLeeeee FrankLeeeee merged commit 5c355b8 into sgl-project:main Dec 2, 2025
2 checks passed
xiaomin-D pushed a commit to eigen-ai-labs/SpecForge_public that referenced this pull request Jan 10, 2026
* added model-download-dir

* polish
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.

1 participant