junhyun01 commited on
Commit
4ebbbf4
·
1 Parent(s): d747df2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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.to('cpu')
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.to('cpu'))
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(share=True)
 
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()