Skip to content

adding trust_remote_code and batch_size #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

abdelkareemkobo
Copy link

I added trust_remote_code to the be default with True Also added the batch_size argument to be 32 as default option

I added trust_remote_code to the be default with True 
Also added the batch_size argument to  be 32 as default option
Copy link
Member

@Pringled Pringled left a comment

Choose a reason for hiding this comment

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

Thanks for making this PR! Almost good to go. Could you "run pre-commit run --all-files" in the virtual environment (after running make install)? That should automatically fix the styling issues.

parser.add_argument(
"--trust-remote-code",
type=bool,
default=True,
Copy link
Member

Choose a reason for hiding this comment

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

I think False is a safer default to choose here, could you update to that?

@@ -18,7 +18,7 @@


def train_model(
model_name: str, train_txt: list[str], train_vec: np.ndarray, device: str = "cpu", vocab_size: int | None = None
model_name: str, train_txt: list[str], train_vec: np.ndarray, device: str = "cpu",batch_size: int= 32, vocab_size: int | None = None,trust_remote_code: bool=True
Copy link
Member

Choose a reason for hiding this comment

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

Small styling issue:

Suggested change
model_name: str, train_txt: list[str], train_vec: np.ndarray, device: str = "cpu",batch_size: int= 32, vocab_size: int | None = None,trust_remote_code: bool=True
model_name: str, train_txt: list[str], train_vec: np.ndarray, device: str = "cpu", batch_size: int= 32, vocab_size: int | None = None, trust_remote_code: bool=True

Copy link
Member

Choose a reason for hiding this comment

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

Also on a couple of other lines, see general PR comment.

parser.add_argument(
"--batch-size",
type=int,
default=32,
Copy link
Member

Choose a reason for hiding this comment

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

This default doesn't match the default in https://github.com/MinishLab/tokenlearn/blob/main/tokenlearn/pretrain.py#L127, could you change to 256 so they match? Same for the default in the train_model function

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.

2 participants