theminji commited on
Commit
e747d24
·
verified ·
1 Parent(s): 1be8f79

fixing again T-T

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -1,12 +1,20 @@
1
  import os
 
 
 
 
 
 
 
 
 
2
  import re
3
  import shutil
4
  import subprocess
5
  import time
6
  import uuid
7
  from threading import Timer
8
- os.environ["TRANSFORMERS_CACHE"] = "/tmp/huggingface_cache"
9
- os.makedirs("/tmp/huggingface_cache", exist_ok=True)
10
  from flask import Flask, render_template, request, url_for, send_from_directory
11
  from google import genai
12
 
 
1
  import os
2
+
3
+ # Set HF_HOME to a writable directory in /tmp
4
+ os.environ["HF_HOME"] = "/tmp/huggingface_cache"
5
+ os.makedirs("/tmp/huggingface_cache", exist_ok=True)
6
+
7
+ # Optionally, you can also set TRANSFORMERS_CACHE for backwards compatibility:
8
+ os.environ["TRANSFORMERS_CACHE"] = "/tmp/huggingface_cache"
9
+
10
+ # Now import the rest of your dependencies
11
  import re
12
  import shutil
13
  import subprocess
14
  import time
15
  import uuid
16
  from threading import Timer
17
+
 
18
  from flask import Flask, render_template, request, url_for, send_from_directory
19
  from google import genai
20