File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 2424from crossfit import op
2525from crossfit .backend .torch .hf .model import HFModel
2626from huggingface_hub import PyTorchModelHubMixin
27- from peft import PeftModel
2827from torch .nn import Dropout , Linear
2928from transformers import AutoConfig , AutoModelForCausalLM , AutoTokenizer
3029
@@ -116,6 +115,11 @@ def __init__(
116115 base_model = AutoModelForCausalLM .from_pretrained (
117116 pretrained_model_name_or_path , torch_dtype = dtype , token = token
118117 )
118+ # Importing PeftModel here to prevent cuda context issues
119+ # that seem to happen on Transformers 4.48.3
120+ # See related: https://github.com/rapidsai/crossfit/pull/113
121+ from peft import PeftModel
122+
119123 self .model = PeftModel .from_pretrained (base_model , peft_model_name_or_path )
120124 self .autocast = autocast
121125 self .add_instruction_data_guard = add_instruction_data_guard
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ dependencies = [
4343 " beautifulsoup4" ,
4444 " charset_normalizer>=3.1.0" ,
4545 " comment_parser" ,
46- " crossfit>=0.0.8" ,
46+ " crossfit>=0.0.8.post1 " ,
4747 " dask-mpi>=2021.11.0" ,
4848 " dask[complete]>=2021.7.1" ,
4949 " datasets" ,
You can’t perform that action at this time.
0 commit comments