File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 1- """The LangSAM model for segmenting objects from satellite images using text prompts.
1+ """The LangSAM model for segmenting objects from satellite images using text prompts.
22The source code is adapted from the https://github.com/luca-medeiros/lang-segment-anything repository.
33Credits to Luca Medeiros for the original implementation.
44"""
@@ -65,11 +65,11 @@ def load_model_hf(
6565 torch.nn.Module: The loaded model.
6666 """
6767
68- cache_config_file = hf_hub_download (repo_id = repo_id , filename = ckpt_config_filename )
68+ cache_config_file = hf_hub_download (repo_id = repo_id , filename = ckpt_config_filename , force_filename = ckpt_config_filename )
6969 args = SLConfig .fromfile (cache_config_file )
7070 model = build_model (args )
7171 model .to (device )
72- cache_file = hf_hub_download (repo_id = repo_id , filename = filename )
72+ cache_file = hf_hub_download (repo_id = repo_id , filename = filename , force_filename = filename )
7373 checkpoint = torch .load (cache_file , map_location = "cpu" )
7474 model .load_state_dict (clean_state_dict (checkpoint ["model" ]), strict = False )
7575 model .eval ()
You can’t perform that action at this time.
0 commit comments