Spaces:
Sleeping
Sleeping
Update app/run.py
Browse files- app/run.py +11 -0
app/run.py
CHANGED
@@ -1,4 +1,15 @@
|
|
1 |
import os
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
import logging
|
3 |
from flask import Flask, request, jsonify
|
4 |
from app.search_engine import PromptSearchEngine
|
|
|
1 |
import os
|
2 |
+
|
3 |
+
# Create the cache directory if it doesn't exist and set permissions
|
4 |
+
hf_cache_dir = '/app/hf_cache'
|
5 |
+
os.makedirs(hf_cache_dir, exist_ok=True)
|
6 |
+
os.chmod(hf_cache_dir, 0o777)
|
7 |
+
|
8 |
+
# Set the HF_HOME environment variable
|
9 |
+
os.environ['HF_HOME'] = hf_cache_dir
|
10 |
+
|
11 |
+
# Application code starts here
|
12 |
+
|
13 |
import logging
|
14 |
from flask import Flask, request, jsonify
|
15 |
from app.search_engine import PromptSearchEngine
|