LukasHug commited on
Commit
bd758e2
·
verified ·
1 Parent(s): d1ec131

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -173,9 +173,10 @@ def load_model(model_path):
173
  processor = AutoProcessor.from_pretrained(model_path, trust_remote_code=True)
174
 
175
  context_len = getattr(model.config, "max_position_embeddings", 8048)
176
- logger.info(f"Model {model_path} loaded successfully")
 
177
  return True
178
-
179
  except Exception as e:
180
  logger.error(f"Error loading model {model_path}: {str(e)}")
181
  return False
 
173
  processor = AutoProcessor.from_pretrained(model_path, trust_remote_code=True)
174
 
175
  context_len = getattr(model.config, "max_position_embeddings", 8048)
176
+ logger.info(f"Model {model_path} loaded successfully to device: {model.device}")
177
+ model = model.to("cuda")
178
  return True
179
+
180
  except Exception as e:
181
  logger.error(f"Error loading model {model_path}: {str(e)}")
182
  return False