Spaces:
Build error
Build error
Jon Solow
commited on
Commit
·
0a03158
1
Parent(s):
0cce591
Remove whitenoise staticfiles and cache model within dir
Browse files
src/grubguesser/settings.py
CHANGED
|
@@ -53,7 +53,6 @@ MIDDLEWARE = [
|
|
| 53 |
"django.contrib.auth.middleware.AuthenticationMiddleware",
|
| 54 |
"django.contrib.messages.middleware.MessageMiddleware",
|
| 55 |
"django.middleware.clickjacking.XFrameOptionsMiddleware",
|
| 56 |
-
"whitenoise.middleware.WhiteNoiseMiddleware",
|
| 57 |
]
|
| 58 |
|
| 59 |
ROOT_URLCONF = "grubguesser.urls"
|
|
@@ -128,8 +127,3 @@ STATICFILES_DIRS = (os.path.join(BASE_DIR, "static"),)
|
|
| 128 |
|
| 129 |
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
|
| 130 |
|
| 131 |
-
|
| 132 |
-
# Simplified static file serving.
|
| 133 |
-
# https://warehouse.python.org/project/whitenoise/
|
| 134 |
-
|
| 135 |
-
STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
|
|
|
|
| 53 |
"django.contrib.auth.middleware.AuthenticationMiddleware",
|
| 54 |
"django.contrib.messages.middleware.MessageMiddleware",
|
| 55 |
"django.middleware.clickjacking.XFrameOptionsMiddleware",
|
|
|
|
| 56 |
]
|
| 57 |
|
| 58 |
ROOT_URLCONF = "grubguesser.urls"
|
|
|
|
| 127 |
|
| 128 |
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
|
| 129 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/huggingface_client/model.py
CHANGED
|
@@ -1,4 +1,10 @@
|
|
| 1 |
from huggingface_hub import from_pretrained_keras
|
| 2 |
|
|
|
|
|
|
|
| 3 |
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
from huggingface_hub import from_pretrained_keras
|
| 2 |
|
| 3 |
+
from pathlib import Path
|
| 4 |
+
import os
|
| 5 |
|
| 6 |
+
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
| 7 |
+
PARENT_DIR = Path(__file__).resolve().parent
|
| 8 |
+
CACHE_DIR = os.path.join(PARENT_DIR, ".cache")
|
| 9 |
+
|
| 10 |
+
MODEL = from_pretrained_keras("jsolow/grubguesser", cache_dir=CACHE_DIR)
|