tejani commited on
Commit
ddbb219
·
verified ·
1 Parent(s): 61f9241

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -9,8 +9,8 @@ from generate import process, load_model, NORMAL_MAP_MODEL, OTHER_MAP_MODEL
9
  # Ensure the utils directory is in the path
10
  sys.path.append(os.path.join(os.path.dirname(__file__), 'utils'))
11
 
12
- # Load models (this should be done once during startup to save time)
13
- device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
14
  normal_map_model = load_model(NORMAL_MAP_MODEL)
15
  other_map_model = load_model(OTHER_MAP_MODEL)
16
  models = [normal_map_model, other_map_model]
@@ -39,7 +39,7 @@ def generate_maps(input_image, tile_size=512, seamless=False, mirror=False, repl
39
  'replicate': replicate,
40
  'ishiiruka': ishiiruka,
41
  'ishiiruka_texture_encoder': ishiiruka_texture_encoder,
42
- 'cpu': not torch.cuda.is_available()
43
  })()
44
 
45
  # Create a mock parser and set args (simulating command-line args)
 
9
  # Ensure the utils directory is in the path
10
  sys.path.append(os.path.join(os.path.dirname(__file__), 'utils'))
11
 
12
+ # Force CPU usage
13
+ device = torch.device('cpu')
14
  normal_map_model = load_model(NORMAL_MAP_MODEL)
15
  other_map_model = load_model(OTHER_MAP_MODEL)
16
  models = [normal_map_model, other_map_model]
 
39
  'replicate': replicate,
40
  'ishiiruka': ishiiruka,
41
  'ishiiruka_texture_encoder': ishiiruka_texture_encoder,
42
+ 'cpu': True # Force CPU usage
43
  })()
44
 
45
  # Create a mock parser and set args (simulating command-line args)