Update app.py
Browse files
app.py
CHANGED
@@ -11,9 +11,9 @@ import gradio as gr
|
|
11 |
|
12 |
DEVICE = config.device
|
13 |
|
14 |
-
MODEL = BERTBaseUncased()
|
15 |
-
MODEL.load_state_dict(torch.load(config.MODEL_PATH, map_location=torch.device(DEVICE)))
|
16 |
-
MODEL.eval()
|
17 |
|
18 |
|
19 |
|
@@ -58,10 +58,10 @@ def sentence_prediction(sentence):
|
|
58 |
|
59 |
# device = config.device
|
60 |
|
61 |
-
|
62 |
# model.load_state_dict(torch.load(
|
63 |
# model_path, map_location=torch.device(device)))
|
64 |
-
|
65 |
|
66 |
outputs, [] = engine.predict_fn(test_data_loader, MODEL, device)
|
67 |
print(outputs)
|
|
|
11 |
|
12 |
DEVICE = config.device
|
13 |
|
14 |
+
# MODEL = BERTBaseUncased()
|
15 |
+
# MODEL.load_state_dict(torch.load(config.MODEL_PATH, map_location=torch.device(DEVICE)))
|
16 |
+
# MODEL.eval()
|
17 |
|
18 |
|
19 |
|
|
|
58 |
|
59 |
# device = config.device
|
60 |
|
61 |
+
model = BERTBaseUncased()
|
62 |
# model.load_state_dict(torch.load(
|
63 |
# model_path, map_location=torch.device(device)))
|
64 |
+
model.to(device)
|
65 |
|
66 |
outputs, [] = engine.predict_fn(test_data_loader, MODEL, device)
|
67 |
print(outputs)
|