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

fine-tune HKUNLP/instructor-embedding #74

Open
Atlantic8 opened this issue Aug 2, 2023 · 7 comments
Open

fine-tune HKUNLP/instructor-embedding #74

Atlantic8 opened this issue Aug 2, 2023 · 7 comments

Comments

@Atlantic8
Copy link

can we fine-tune using train.py based on the released model hkunlp/instructor-xl? If yes, could you please show me the shell script for training? thanks

@Atlantic8
Copy link
Author

I only have training data with format: sentence1, sentence2, label
so I cannot construct training data with format: query=xxx, pos=[], neg=[]

@Atlantic8
Copy link
Author

Also, when I trying to train using train.py, with "--fp16 True --gradient_accumulation_steps 3", I got out of GPU memory. I was using A100 40G. why training this model takes this much GPU memory. could you tell me the GPU hardware you used to train this model?

@Atlantic8
Copy link
Author

btw, this model can be trained only when per_device_train_batch_size is set to 2

@ashokrajab
Copy link
Contributor

could you tell me the GPU hardware you used to train this model?

@Atlantic8 , this is an excerpt from the paper:

We use the maximum batch size that fits the machine memory and run all our experiments on 40GB A100 GPUs.

@taziksh
Copy link

taziksh commented Oct 24, 2023

btw, this model can be trained only when per_device_train_batch_size is set to 2

What's your source for this? @Atlantic8

@hongjin-su
Copy link
Collaborator

Hi, Thanks a lot for your interest in the INSTRUCTOR!

  1. As the INSTRUCTOR model follows the same architecture as GTR models, the same training script should be applicable.
  2. If you have only paired sentences (I assume that they are positive pairs, e.g., question and answer), then using random negatives is probably the easiest way to construct the training data.
  3. For the xl model, the maximum length, gradient accumulation steps and batch size should depend on your machines.

Hope this helps!

@EricPaul03
Copy link

Hi, Thanks a lot for your interest in the INSTRUCTOR!

  1. As the INSTRUCTOR model follows the same architecture as GTR models, the same training script should be applicable.
  2. If you have only paired sentences (I assume that they are positive pairs, e.g., question and answer), then using random negatives is probably the easiest way to construct the training data.
  3. For the xl model, the maximum length, gradient accumulation steps and batch size should depend on your machines.

Hope this helps!

So for custom data, do we need to randomly construct a data format like query=xxx, pos=[], neg=[] before running?

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

5 participants