Upload folder using huggingface_hub
Browse files- modeling_flmr.py +4 -1
modeling_flmr.py
CHANGED
@@ -645,7 +645,10 @@ class FLMRModelForRetrieval(FLMRPretrainedModelForRetrieval):
|
|
645 |
self._tied_weights_keys += ["context_vision_encoder", "context_vision_projection"]
|
646 |
|
647 |
if self.config.load_cpu_extension:
|
648 |
-
|
|
|
|
|
|
|
649 |
|
650 |
if self.config.mask_punctuation:
|
651 |
self.skiplist = {
|
|
|
645 |
self._tied_weights_keys += ["context_vision_encoder", "context_vision_projection"]
|
646 |
|
647 |
if self.config.load_cpu_extension:
|
648 |
+
try:
|
649 |
+
FLMRModelForRetrieval.try_load_torch_extensions()
|
650 |
+
except Exception as e:
|
651 |
+
raise(f"Unable to load `segmented_maxsim.cpp`. hf-hub does not download this file automatically. Please download it manually from `https://huggingface.co/LinWeizheDragon/PreFLMR_ViT-L/blob/main/segmented_maxsim.cpp` and put it under the same folder as the model file.\n {e}")
|
652 |
|
653 |
if self.config.mask_punctuation:
|
654 |
self.skiplist = {
|