Spaces:
Runtime error
Runtime error
Update src/app/model.py
Browse files- src/app/model.py +1 -2
src/app/model.py
CHANGED
@@ -40,14 +40,13 @@ def load_model_tokenizer_and_processor(model_name: str, device: str) -> Any:
|
|
40 |
torch_dtype=torch.bfloat16,
|
41 |
token=access_token
|
42 |
)
|
43 |
-
model = model.to(device=device)
|
44 |
tokenizer = AutoTokenizer.from_pretrained(
|
45 |
model_name, trust_remote_code=True, token=access_token
|
46 |
)
|
47 |
processor = AutoProcessor.from_pretrained(
|
48 |
model_name, trust_remote_code=True, token=access_token
|
49 |
)
|
50 |
-
model.eval()
|
51 |
|
52 |
# Log the successful loading of the model, tokenizer and processor
|
53 |
logging.info("Model, tokenizer and processor loaded successfully.")
|
|
|
40 |
torch_dtype=torch.bfloat16,
|
41 |
token=access_token
|
42 |
)
|
43 |
+
model = model.eval().to(device=device)
|
44 |
tokenizer = AutoTokenizer.from_pretrained(
|
45 |
model_name, trust_remote_code=True, token=access_token
|
46 |
)
|
47 |
processor = AutoProcessor.from_pretrained(
|
48 |
model_name, trust_remote_code=True, token=access_token
|
49 |
)
|
|
|
50 |
|
51 |
# Log the successful loading of the model, tokenizer and processor
|
52 |
logging.info("Model, tokenizer and processor loaded successfully.")
|