maxoul commited on
Commit
ad75b95
·
verified ·
1 Parent(s): 6c95abb

Update splade.py

Browse files
Files changed (1) hide show
  1. splade.py +5 -5
splade.py CHANGED
@@ -22,10 +22,10 @@ class SpladeConfig(PretrainedConfig):
22
 
23
  def __init__(
24
  self,
25
- model_name_or_path: str = "meta-llama/Llama-3.1-8B",
26
  attn_implementation: str = "flash_attention_2",
27
  bidirectional: bool = True, # only for decoder models
28
- padding_side: str = "right",
29
  **kwargs,
30
  ):
31
  super().__init__(**kwargs)
@@ -72,15 +72,15 @@ class Splade(PreTrainedModel):
72
  def from_pretrained(cls, model_name_or_path, *args, **kwargs):
73
  config = SpladeConfig.from_pretrained(model_name_or_path)
74
  model = cls(config)
75
- # local_dir = snapshot_download(model_name_or_path)
76
- # adapter_path = os.path.join(local_dir, "lora")
77
- # model.model.load_adapter(adapter_path)
78
  model.model = PeftModel.from_pretrained(
79
  model.model,
80
  model_name_or_path,
81
  subfolder="lora",
82
  token=kwargs.get("token", None),
83
  )
 
 
 
84
  # model.model = PeftModel.from_pretrained(model.model, adapter_path)
85
  model.reverse_voc = {v: k for k, v in model.tokenizer.vocab.items()}
86
  return model
 
22
 
23
  def __init__(
24
  self,
25
+ model_name_or_path: str = "Qwen/Qwen3-8B",
26
  attn_implementation: str = "flash_attention_2",
27
  bidirectional: bool = True, # only for decoder models
28
+ padding_side: str = "left",
29
  **kwargs,
30
  ):
31
  super().__init__(**kwargs)
 
72
  def from_pretrained(cls, model_name_or_path, *args, **kwargs):
73
  config = SpladeConfig.from_pretrained(model_name_or_path)
74
  model = cls(config)
 
 
 
75
  model.model = PeftModel.from_pretrained(
76
  model.model,
77
  model_name_or_path,
78
  subfolder="lora",
79
  token=kwargs.get("token", None),
80
  )
81
+ # local_dir = snapshot_download(model_name_or_path)
82
+ # adapter_path = os.path.join(local_dir, "lora")
83
+ # model.model.load_adapter(adapter_path)
84
  # model.model = PeftModel.from_pretrained(model.model, adapter_path)
85
  model.reverse_voc = {v: k for k, v in model.tokenizer.vocab.items()}
86
  return model