Spaces:
Build error
Build error
ShAnSantosh
commited on
Commit
·
5a0b3dd
1
Parent(s):
05bc6a7
Update app.py
Browse files
app.py
CHANGED
@@ -18,14 +18,15 @@ with open('./intents.json', 'r') as json_data:
|
|
18 |
intents = json.load(json_data)
|
19 |
|
20 |
FILE = "./data.pth"
|
21 |
-
data = torch.load(FILE
|
|
|
22 |
|
23 |
input_size = data["input_size"]
|
24 |
hidden_size = data["hidden_size"]
|
25 |
output_size = data["output_size"]
|
26 |
all_words = data['all_words']
|
27 |
tags = data['tags']
|
28 |
-
model_state = data["model_state"]
|
29 |
|
30 |
model = NeuralNet(input_size, hidden_size, output_size).to(device)
|
31 |
model.load_state_dict(model_state)
|
|
|
18 |
intents = json.load(json_data)
|
19 |
|
20 |
FILE = "./data.pth"
|
21 |
+
data = torch.load(FILE)
|
22 |
+
model_state = torch.load(FILE['model_state'], map_location=torch.device('cpu'))
|
23 |
|
24 |
input_size = data["input_size"]
|
25 |
hidden_size = data["hidden_size"]
|
26 |
output_size = data["output_size"]
|
27 |
all_words = data['all_words']
|
28 |
tags = data['tags']
|
29 |
+
#model_state = data["model_state"]
|
30 |
|
31 |
model = NeuralNet(input_size, hidden_size, output_size).to(device)
|
32 |
model.load_state_dict(model_state)
|