Update app.py
Browse files
app.py
CHANGED
|
@@ -23,7 +23,7 @@ def paragraph_leveling(text):
|
|
| 23 |
|
| 24 |
classifier = MLP(target_size=3, input_size=768)
|
| 25 |
classifier.load_state_dict(torch.load('./trained_model/fine_tunning_classifier', map_location=torch.device('cpu')))
|
| 26 |
-
classifier
|
| 27 |
classifier.eval()
|
| 28 |
|
| 29 |
output_list = []
|
|
@@ -45,7 +45,7 @@ def paragraph_leveling(text):
|
|
| 45 |
padding='max_length',
|
| 46 |
truncation=True,
|
| 47 |
max_length=120)
|
| 48 |
-
output = model(**train_encoding
|
| 49 |
output = classifier(output[1])
|
| 50 |
output = output[0]
|
| 51 |
|
|
@@ -89,4 +89,4 @@ demo = gr.Interface(
|
|
| 89 |
theme=gr.themes.Base()
|
| 90 |
)
|
| 91 |
if __name__ == "__main__":
|
| 92 |
-
demo.launch(
|
|
|
|
| 23 |
|
| 24 |
classifier = MLP(target_size=3, input_size=768)
|
| 25 |
classifier.load_state_dict(torch.load('./trained_model/fine_tunning_classifier', map_location=torch.device('cpu')))
|
| 26 |
+
classifier
|
| 27 |
classifier.eval()
|
| 28 |
|
| 29 |
output_list = []
|
|
|
|
| 45 |
padding='max_length',
|
| 46 |
truncation=True,
|
| 47 |
max_length=120)
|
| 48 |
+
output = model(**train_encoding)
|
| 49 |
output = classifier(output[1])
|
| 50 |
output = output[0]
|
| 51 |
|
|
|
|
| 89 |
theme=gr.themes.Base()
|
| 90 |
)
|
| 91 |
if __name__ == "__main__":
|
| 92 |
+
demo.launch()
|