supertskone commited on
Commit
dca3f11
·
verified ·
1 Parent(s): d073b41

Update app/run.py

Browse files
Files changed (1) hide show
  1. app/run.py +4 -7
app/run.py CHANGED
@@ -1,13 +1,10 @@
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
-
7
- # Set the HF_HOME environment variable
8
- os.environ['HF_HOME'] = hf_cache_dir
9
 
10
- # Application code starts here
 
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