Tin113 commited on
Commit
4e5872e
·
verified ·
1 Parent(s): f9552a1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -0
app.py CHANGED
@@ -1,3 +1,12 @@
 
 
 
 
 
 
 
 
 
1
 
2
  import gradio as gr
3
  import torch
 
1
+ import os
2
+ import torch
3
+
4
+ # CRITICAL: Redirect cache to temporary storage
5
+ os.environ['TORCH_HOME'] = '/tmp/torch_cache'
6
+ os.environ['HUB_DIR'] = '/tmp/torch_hub'
7
+ os.environ['TMPDIR'] = '/tmp'
8
+ torch.hub.set_dir('/tmp/torch_hub')
9
+
10
 
11
  import gradio as gr
12
  import torch