Skip to content
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

"trust_remote_code=True" problem #754

Open
yingxin-chen opened this issue Apr 10, 2024 · 1 comment
Open

"trust_remote_code=True" problem #754

yingxin-chen opened this issue Apr 10, 2024 · 1 comment

Comments

@yingxin-chen
Copy link

Hi author, when I use your project to fine-tune a local model, I get the following prompt
"trust_remote_code=True"
Where should I change the code? Can you provide an example?

@research4pan
Copy link
Contributor

research4pan commented Apr 10, 2024

Thanks for your interest in LMFlow! You may set --trust_remote_code 1 when running the python script or deepspeed script

deepspeed ${deepspeed_args} \
  examples/finetune.py \
    --trust_remote_code 1   \
    --model_name_or_path ${model_name_or_path} \
    --dataset_path ${dataset_path} \
    --output_dir ${output_dir} --overwrite_output_dir \
    --num_train_epochs 0.01 \
    ...
    | tee ${log_dir}/train.log \
    2> ${log_dir}/train.err

or

python3 \
  examples/finetune.py \
    --trust_remote_code 1   \
    --model_name_or_path ${model_name_or_path} \
    --dataset_path ${dataset_path} \
    --output_dir ${output_dir} --overwrite_output_dir \
    --num_train_epochs 0.01 \
    ...
    | tee ${log_dir}/train.log \
    2> ${log_dir}/train.err

Or if you prefer to modify the python code directly, you may check the code pieces located in src/lmflow/models/hf_decoder_model.py. There are several other places, which you can modify them all to allow trust_remote_code to be switched on for both inference and finetune. Hope that can be helpful 😄

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

No branches or pull requests

2 participants