Julian Bilcke commited on
Commit
9e97556
·
1 Parent(s): 7bc8667

new fix to try

Browse files
Files changed (1) hide show
  1. app.py +9 -7
app.py CHANGED
@@ -1,4 +1,13 @@
1
  import os
 
 
 
 
 
 
 
 
 
2
  import torch
3
  import gradio as gr
4
  import numpy as np
@@ -15,13 +24,6 @@ from hymm_sp.data_kits.data_tools import save_videos_grid
15
  from hymm_sp.config import parse_args
16
  import argparse
17
 
18
- # Get weights path from environment variable or use default
19
- WEIGHTS_PATH = os.environ.get("WEIGHTS_PATH", "/data/weights")
20
-
21
- os.environ["MODEL_BASE"] = os.path.join(WEIGHTS_PATH, "stdmodels")
22
- os.environ["DISABLE_SP"] = "1"
23
- os.environ["CPU_OFFLOAD"] = "1"
24
-
25
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
26
 
27
  class CropResize:
 
1
  import os
2
+
3
+ # Get weights path from environment variable or use default
4
+ WEIGHTS_PATH = os.environ.get("WEIGHTS_PATH", "/data/weights")
5
+
6
+ # IMPORTANT: Set environment variables BEFORE importing any modules that use them
7
+ os.environ["MODEL_BASE"] = os.path.join(WEIGHTS_PATH, "stdmodels")
8
+ os.environ["DISABLE_SP"] = "1"
9
+ os.environ["CPU_OFFLOAD"] = "1"
10
+
11
  import torch
12
  import gradio as gr
13
  import numpy as np
 
24
  from hymm_sp.config import parse_args
25
  import argparse
26
 
 
 
 
 
 
 
 
27
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
28
 
29
  class CropResize: