File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -95,13 +95,26 @@ def __init__(
9595        model_path  =  self .path  /  "model.onnx" 
9696        optimized_model_path  =  self .path  /  "model_optimized.onnx" 
9797
98+         xenova_model_path  =  self .path  /  "onnx"  /  "model.onnx" 
99+         xenova_optimized_model_path  =  self .path  /  "onnx"  /  "model_optimized.onnx" 
100+ 
98101        # List of Execution Providers: https://onnxruntime.ai/docs/execution-providers 
99102        onnx_providers  =  ["CPUExecutionProvider" ]
100103
101104        if  not  model_path .exists ():
102105            # Rename file model_optimized.onnx to model.onnx if it exists 
103106            if  optimized_model_path .exists ():
104107                optimized_model_path .rename (model_path )
108+ 
109+             # Patch for inconsistent repo structure at 
110+             # - https://huggingface.co/Xenova/jina-embeddings-v2-small-en 
111+             # - https://huggingface.co/Xenova/jina-embeddings-v2-base-en 
112+             elif  xenova_model_path .exists ():
113+                 model_path  =  xenova_model_path 
114+ 
115+             elif  xenova_optimized_model_path .exists ():
116+                 model_path  =  xenova_optimized_model_path 
117+ 
105118            else :
106119                raise  ValueError (f"Could not find model.onnx in { self .path }  )
107120
Original file line number Diff line number Diff line change 8383        "description" : "  English embedding model supporting 8192 sequence length" 
8484        "size_in_GB" : 0.55 ,
8585        "hf_sources" : [
86-             " jinaai /jina-embeddings-v2-base-en" 
86+             " xenova /jina-embeddings-v2-base-en" 
8787        ],
8888        "compressed_url_sources" : []
8989    },
9393        "description" : "  English embedding model supporting 8192 sequence length" 
9494        "size_in_GB" : 0.13 ,
9595        "hf_sources" : [
96-             " jinaai /jina-embeddings-v2-small-en" 
96+             " xenova /jina-embeddings-v2-small-en" 
9797        ],
9898        "compressed_url_sources" : []
9999    },
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments