jupyterjazz commited on
Commit
82b68d6
1 Parent(s): 9dc6033

fix: loading from st

Browse files
Files changed (1) hide show
  1. modeling_lora.py +3 -0
modeling_lora.py CHANGED
@@ -335,6 +335,9 @@ class XLMRobertaLoRA(XLMRobertaPreTrainedModel):
335
  use_safetensors: bool = None,
336
  **kwargs,
337
  ):
 
 
 
338
  if config.load_trained_adapters: # checkpoint already contains LoRA adapters
339
  return super().from_pretrained(
340
  pretrained_model_name_or_path,
 
335
  use_safetensors: bool = None,
336
  **kwargs,
337
  ):
338
+ for key in list(kwargs.keys()):
339
+ if key in config:
340
+ config.update({key: kwargs.pop(key)})
341
  if config.load_trained_adapters: # checkpoint already contains LoRA adapters
342
  return super().from_pretrained(
343
  pretrained_model_name_or_path,