Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
@@ -31,7 +31,7 @@ except Exception as e:
|
|
31 |
# --- Download from S3 (CPU models only) ---
|
32 |
def download_from_s3():
|
33 |
print("Attempting to download artifacts from S3...")
|
34 |
-
BUCKET_NAME = '
|
35 |
ARTIFACTS = [
|
36 |
'kserve-ig/vegfruits-classifier-prod/pths/vegfruits_cpu.pt',
|
37 |
'kserve-ig/sports-classifier-prod/pths/sports_cpu.pt',
|
@@ -80,7 +80,7 @@ transform = transforms.Compose([
|
|
80 |
# --- Load models ---
|
81 |
def load_model(name):
|
82 |
print(f"Loading model: {name}")
|
83 |
-
#
|
84 |
path = f"{name}/{name}_cpu.pt"
|
85 |
try:
|
86 |
if not os.path.exists(path):
|
@@ -290,4 +290,4 @@ def main():
|
|
290 |
traceback.print_exc()
|
291 |
|
292 |
if __name__ == "__main__":
|
293 |
-
main()
|
|
|
31 |
# --- Download from S3 (CPU models only) ---
|
32 |
def download_from_s3():
|
33 |
print("Attempting to download artifacts from S3...")
|
34 |
+
BUCKET_NAME = 'emlo-project'
|
35 |
ARTIFACTS = [
|
36 |
'kserve-ig/vegfruits-classifier-prod/pths/vegfruits_cpu.pt',
|
37 |
'kserve-ig/sports-classifier-prod/pths/sports_cpu.pt',
|
|
|
80 |
# --- Load models ---
|
81 |
def load_model(name):
|
82 |
print(f"Loading model: {name}")
|
83 |
+
# emlo-project/kserve-ig/vegfruits-classifier-prod/pths/
|
84 |
path = f"{name}/{name}_cpu.pt"
|
85 |
try:
|
86 |
if not os.path.exists(path):
|
|
|
290 |
traceback.print_exc()
|
291 |
|
292 |
if __name__ == "__main__":
|
293 |
+
main()
|