Spaces:
Sleeping
Sleeping
Enable direct CDN downloads of quantized MiniLM vectors
Browse files- backend/app.py +3 -3
backend/app.py
CHANGED
|
@@ -131,8 +131,8 @@ def health():
|
|
| 131 |
|
| 132 |
|
| 133 |
_ASSET_PATH = re.compile(
|
| 134 |
-
r"(?:openai/)?(?:manifest\.json|(?:ICD10CM|ICD9CM|ICPC|MDR|RCD2|SNOMEDCT_US)-[0-9a-f]{20}/"
|
| 135 |
-
r"(?:lexical\.json\.gz|[0-9]{7}\.(?:json\.gz|f32)))\Z"
|
| 136 |
)
|
| 137 |
|
| 138 |
|
|
@@ -155,7 +155,7 @@ def terminology_asset(asset_path: str):
|
|
| 155 |
client = httpx.Client(timeout=60, follow_redirects=True)
|
| 156 |
url = f"https://huggingface.co/datasets/{repo}/resolve/{revision}/{asset_path}"
|
| 157 |
public = os.getenv("PIPELINE_PUBLIC_ACCESS", "").lower() == "true"
|
| 158 |
-
if public and asset_path.endswith(".f32"):
|
| 159 |
# Let the CDN serve large vectors directly. Only the temporary link to
|
| 160 |
# this file reaches the browser; the HF access token stays server-side.
|
| 161 |
try:
|
|
|
|
| 131 |
|
| 132 |
|
| 133 |
_ASSET_PATH = re.compile(
|
| 134 |
+
r"(?:(?:openai|minilm-int8)/)?(?:manifest\.json|(?:ICD10CM|ICD9CM|ICPC|MDR|RCD2|SNOMEDCT_US)-[0-9a-f]{20}/"
|
| 135 |
+
r"(?:lexical\.json\.gz|[0-9]{7}\.(?:json\.gz|f32|i8)))\Z"
|
| 136 |
)
|
| 137 |
|
| 138 |
|
|
|
|
| 155 |
client = httpx.Client(timeout=60, follow_redirects=True)
|
| 156 |
url = f"https://huggingface.co/datasets/{repo}/resolve/{revision}/{asset_path}"
|
| 157 |
public = os.getenv("PIPELINE_PUBLIC_ACCESS", "").lower() == "true"
|
| 158 |
+
if public and asset_path.endswith((".f32", ".i8")):
|
| 159 |
# Let the CDN serve large vectors directly. Only the temporary link to
|
| 160 |
# this file reaches the browser; the HF access token stays server-side.
|
| 161 |
try:
|