arithescientist commited on
Commit
68664f3
·
1 Parent(s): 9d89cb5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -6
app.py CHANGED
@@ -21,12 +21,10 @@ def get_response(input_text):
21
  model_name = 'nlpaueb/legal-bert-base-uncased'
22
 
23
 
24
- # The setup of huggingface.co
25
- custom_config = AutoConfig.from_pretrained(model_name)
26
- custom_config.output_hidden_states=True
27
- custom_tokenizer = AutoTokenizer.from_pretrained(model_name)
28
- custom_model = AutoModel.from_pretrained(model_name, config=custom_config)
29
- bert_legal_model = Summarizer(custom_model=custom_model, custom_tokenizer=custom_tokenizer)
30
 
31
 
32
  output_text= bert_legal_model(input_text, min_length = 8, ratio = 0.05)
 
21
  model_name = 'nlpaueb/legal-bert-base-uncased'
22
 
23
 
24
+ tokenizer = AutoTokenizer.from_pretrained(model_name )
25
+
26
+ model = AutoModelForPreTraining.from_pretrained(model_name)
27
+ bert_legal_model = Summarizer(custom_model=model, custom_tokenizer=tokenizer)
 
 
28
 
29
 
30
  output_text= bert_legal_model(input_text, min_length = 8, ratio = 0.05)