aritheanalyst commited on
Commit
ad63b2b
1 Parent(s): 6ee4162

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -19,12 +19,13 @@ model_name = 'nlpaueb/legal-bert-base-uncased'
19
  #model_name = 'laxya007/gpt2_legal'
20
  # model_name = 'facebook/bart-large-cnn'
21
 
22
- # The setup of huggingface.co
23
- custom_config = AutoConfig.from_pretrained(model_name)
24
- custom_config.output_hidden_states=True
25
- custom_tokenizer = AutoTokenizer.from_pretrained(model_name)
26
- custom_model = AutoModel.from_pretrained(model_name, config=custom_config)
27
- bert_legal_model = Summarizer(custom_model=custom_model, custom_tokenizer=custom_tokenizer)
 
28
  print('Using model {}\n'.format(model_name))
29
 
30
 
19
  #model_name = 'laxya007/gpt2_legal'
20
  # model_name = 'facebook/bart-large-cnn'
21
 
22
+
23
+ from transformers import AutoTokenizer, AutoModelForCausalLM
24
+
25
+ tokenizer = AutoTokenizer.from_pretrained("laxya007/gpt2_BSA_Legal_Initiproject_OE_OS_BRM")
26
+
27
+ model = AutoModelForCausalLM.from_pretrained("laxya007/gpt2_BSA_Legal_Initiproject_OE_OS_BRM")
28
+ bert_legal_model = Summarizer(custom_model= model, custom_tokenizer= tokenizer)
29
  print('Using model {}\n'.format(model_name))
30
 
31