Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -148,8 +148,8 @@ def predict_raw(raw_input):
|
|
148 |
_, dataloader = generate_dataset_dataloader(ids, seqs)
|
149 |
|
150 |
model = CNN_linear()
|
151 |
-
st.write(model.state_dict().keys())
|
152 |
-
st.write({k.replace('module.', ''):v for k,v in torch.load(modelfile, map_location=torch.device('cpu')).items()}.keys())
|
153 |
model.load_state_dict({k.replace('module.', ''):v for k,v in torch.load(modelfile, map_location=torch.device('cpu')).items()}, strict = True)
|
154 |
# model.load_state_dict(torch.load(modelfile, map_location=torch.device('cpu')), strict = False)
|
155 |
|
|
|
148 |
_, dataloader = generate_dataset_dataloader(ids, seqs)
|
149 |
|
150 |
model = CNN_linear()
|
151 |
+
# st.write(model.state_dict().keys())
|
152 |
+
# st.write({k.replace('module.', ''):v for k,v in torch.load(modelfile, map_location=torch.device('cpu')).items()}.keys())
|
153 |
model.load_state_dict({k.replace('module.', ''):v for k,v in torch.load(modelfile, map_location=torch.device('cpu')).items()}, strict = True)
|
154 |
# model.load_state_dict(torch.load(modelfile, map_location=torch.device('cpu')), strict = False)
|
155 |
|