edwardb1203 commited on
Commit
c86bf0a
1 Parent(s): 00c0b2c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -7
app.py CHANGED
@@ -1,18 +1,12 @@
1
  from transformers import LEDTokenizer, LEDForConditionalGeneration
2
  import torch
3
  import re
4
- tokenizer = LEDTokenizer.from_pretrained("patrickvonplaten/led-large-16384-pubmed")
5
- model = LEDForConditionalGeneration.from_pretrained("patrickvonplaten/led-large-16384-pubmed").to("cuda").half()
6
-
7
  import gradio as gr
8
  import os
9
  import docx2txt
10
 
11
-
12
  tokenizer = LEDTokenizer.from_pretrained("patrickvonplaten/led-large-16384-pubmed")
13
- model = LEDForConditionalGeneration.from_pretrained("patrickvonplaten/led-large-16384-pubmed", return_dict_in_generate=True).to("cuda")
14
-
15
-
16
 
17
  def summarize(text_file):
18
  file_extension = os.path.splitext(text_file.name)[1]
 
1
  from transformers import LEDTokenizer, LEDForConditionalGeneration
2
  import torch
3
  import re
 
 
 
4
  import gradio as gr
5
  import os
6
  import docx2txt
7
 
 
8
  tokenizer = LEDTokenizer.from_pretrained("patrickvonplaten/led-large-16384-pubmed")
9
+ model = LEDForConditionalGeneration.from_pretrained("patrickvonplaten/led-large-16384-pubmed").to("cuda").half()
 
 
10
 
11
  def summarize(text_file):
12
  file_extension = os.path.splitext(text_file.name)[1]