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

Update run.py

Browse files
Files changed (1) hide show
  1. run.py +11 -0
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