Spaces:
Sleeping
Sleeping
Update app/run.py
Browse files- app/run.py +4 -7
app/run.py
CHANGED
@@ -1,13 +1,10 @@
|
|
1 |
import os
|
2 |
|
3 |
-
#
|
4 |
-
hf_cache_dir = '/app/hf_cache'
|
5 |
-
os.makedirs(hf_cache_dir, exist_ok=True)
|
6 |
-
|
7 |
-
# Set the HF_HOME environment variable
|
8 |
-
os.environ['HF_HOME'] = hf_cache_dir
|
9 |
|
10 |
-
#
|
|
|
11 |
|
12 |
import logging
|
13 |
from flask import Flask, request, jsonify
|
|
|
1 |
import os
|
2 |
|
3 |
+
# Ensure the HF_HOME environment variable is set correctly
|
4 |
+
hf_cache_dir = os.getenv('HF_HOME', '/app/hf_cache')
|
|
|
|
|
|
|
|
|
5 |
|
6 |
+
# Ensure the directory exists
|
7 |
+
os.makedirs(hf_cache_dir, exist_ok=True)
|
8 |
|
9 |
import logging
|
10 |
from flask import Flask, request, jsonify
|