Spaces:
Running
Running
deploy: sync encoder from 240af2d
Browse files- text_encoder.py +2 -1
text_encoder.py
CHANGED
|
@@ -36,7 +36,8 @@ _TOKENIZER = None
|
|
| 36 |
|
| 37 |
|
| 38 |
def load_session() -> ort.InferenceSession:
|
| 39 |
-
"""
|
|
|
|
| 40 |
global _SESSION
|
| 41 |
if _SESSION is None:
|
| 42 |
path = hf_hub_download(MODEL_REPO, ONNX_FILE)
|
|
|
|
| 36 |
|
| 37 |
|
| 38 |
def load_session() -> ort.InferenceSession:
|
| 39 |
+
"""Resolve the text ONNX (baked into the image in production, HF-hub-cached
|
| 40 |
+
elsewhere) and build a CPU session once."""
|
| 41 |
global _SESSION
|
| 42 |
if _SESSION is None:
|
| 43 |
path = hf_hub_download(MODEL_REPO, ONNX_FILE)
|