supertskone commited on
Commit
d6f77c9
·
verified ·
1 Parent(s): e7dc147

Update app/run.py

Browse files
Files changed (1) hide show
  1. 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