Commit 5adf3f6 1 parent ede507e commit 5adf3f6 Copy full SHA for 5adf3f6
File tree 2 files changed +15
-2
lines changed
2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -95,13 +95,26 @@ def __init__(
95
95
model_path = self .path / "model.onnx"
96
96
optimized_model_path = self .path / "model_optimized.onnx"
97
97
98
+ xenova_model_path = self .path / "onnx" / "model.onnx"
99
+ xenova_optimized_model_path = self .path / "onnx" / "model_optimized.onnx"
100
+
98
101
# List of Execution Providers: https://onnxruntime.ai/docs/execution-providers
99
102
onnx_providers = ["CPUExecutionProvider" ]
100
103
101
104
if not model_path .exists ():
102
105
# Rename file model_optimized.onnx to model.onnx if it exists
103
106
if optimized_model_path .exists ():
104
107
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
+
105
118
else :
106
119
raise ValueError (f"Could not find model.onnx in { self .path } " )
107
120
Original file line number Diff line number Diff line change 83
83
"description" : " English embedding model supporting 8192 sequence length" ,
84
84
"size_in_GB" : 0.55 ,
85
85
"hf_sources" : [
86
- " jinaai /jina-embeddings-v2-base-en"
86
+ " xenova /jina-embeddings-v2-base-en"
87
87
],
88
88
"compressed_url_sources" : []
89
89
},
93
93
"description" : " English embedding model supporting 8192 sequence length" ,
94
94
"size_in_GB" : 0.13 ,
95
95
"hf_sources" : [
96
- " jinaai /jina-embeddings-v2-small-en"
96
+ " xenova /jina-embeddings-v2-small-en"
97
97
],
98
98
"compressed_url_sources" : []
99
99
},
You can’t perform that action at this time.
0 commit comments