Spaces:
Sleeping
Sleeping
Updates t5 model to load with cpu.
Browse files- model/t5.py +1 -1
model/t5.py
CHANGED
@@ -20,7 +20,7 @@ class T5ClassificationModel(nn.Module):
|
|
20 |
self.base_model = T5EncoderModel(config)
|
21 |
|
22 |
# Load the state_dict and remove unwanted keys
|
23 |
-
state_dict = torch.load(pytorch_model_path)
|
24 |
filtered_state_dict = {
|
25 |
k.replace("base_model.", ""): v
|
26 |
for k, v in state_dict.items()
|
|
|
20 |
self.base_model = T5EncoderModel(config)
|
21 |
|
22 |
# Load the state_dict and remove unwanted keys
|
23 |
+
state_dict = torch.load(pytorch_model_path, map_location=torch.device("cpu"))
|
24 |
filtered_state_dict = {
|
25 |
k.replace("base_model.", ""): v
|
26 |
for k, v in state_dict.items()
|