Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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
|