Feature Extraction
Transformers
Safetensors
diva
custom_code
WillHeld commited on
Commit
72ed899
1 Parent(s): ef73e7d

Update modeling_diva.py

Browse files
Files changed (1) hide show
  1. modeling_diva.py +2 -6
modeling_diva.py CHANGED
@@ -135,20 +135,16 @@ class DiVAModel(PreTrainedModel):
135
  # Loading from huggingface repo
136
  from huggingface_hub import hf_hub_download
137
 
138
- hf_hub_download(
139
  repo_id=pretrained_model_name_or_path,
140
  filename="model.safetensors",
141
  token=kwargs.get("token", None),
142
- cache_dir=os.path.dirname(__file__),
143
  )
144
- hf_hub_download(
145
  repo_id=pretrained_model_name_or_path,
146
  filename="config.json",
147
  token=kwargs.get("token", None),
148
- cache_dir=os.path.dirname(__file__),
149
  )
150
- via_path = os.path.dirname(__file__) + "/model.safetensors"
151
- config_path = os.path.dirname(__file__) + "/config.json"
152
  with open(config_path, "r") as f:
153
  config_dict = json.loads(f.read())
154
  return cls(
 
135
  # Loading from huggingface repo
136
  from huggingface_hub import hf_hub_download
137
 
138
+ via_path = hf_hub_download(
139
  repo_id=pretrained_model_name_or_path,
140
  filename="model.safetensors",
141
  token=kwargs.get("token", None),
 
142
  )
143
+ config_path = hf_hub_download(
144
  repo_id=pretrained_model_name_or_path,
145
  filename="config.json",
146
  token=kwargs.get("token", None),
 
147
  )
 
 
148
  with open(config_path, "r") as f:
149
  config_dict = json.loads(f.read())
150
  return cls(