Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
set to eval
Browse filesSigned-off-by: peter szemraj <[email protected]>
- summarize.py +3 -0
summarize.py
CHANGED
@@ -21,9 +21,12 @@ def load_model_and_tokenizer(model_name):
|
|
21 |
# low_cpu_mem_usage=True,
|
22 |
# use_cache=False,
|
23 |
).to(device)
|
|
|
|
|
24 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
25 |
|
26 |
logging.info(f"Loaded model {model_name} to {device}")
|
|
|
27 |
return model, tokenizer
|
28 |
|
29 |
|
|
|
21 |
# low_cpu_mem_usage=True,
|
22 |
# use_cache=False,
|
23 |
).to(device)
|
24 |
+
model = model.eval()
|
25 |
+
|
26 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
27 |
|
28 |
logging.info(f"Loaded model {model_name} to {device}")
|
29 |
+
|
30 |
return model, tokenizer
|
31 |
|
32 |
|