Spaces:
Runtime error
Runtime error
Commit
·
eb83f46
1
Parent(s):
f9a9a42
Update app.py
Browse files
app.py
CHANGED
@@ -24,7 +24,7 @@ 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 |
|
@@ -56,7 +56,7 @@ def lincoln(content):
|
|
56 |
text = paragraph
|
57 |
# encoding the input text
|
58 |
bert_legal_model(content)
|
59 |
-
summary = bert_legal_model(text,
|
60 |
# summary = tokenizer_t5.decode(summary_ids[0], skip_special_tokens=True)
|
61 |
summary_text += str(summary) + "\n\n"
|
62 |
print("Summary:")
|
|
|
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(model = "distilbert-base-uncased", custom_model=custom_model, custom_tokenizer=custom_tokenizer)
|
28 |
print('Using model {}\n'.format(model_name))
|
29 |
|
30 |
|
|
|
56 |
text = paragraph
|
57 |
# encoding the input text
|
58 |
bert_legal_model(content)
|
59 |
+
summary = bert_legal_model(text, ratio = 0.01)
|
60 |
# summary = tokenizer_t5.decode(summary_ids[0], skip_special_tokens=True)
|
61 |
summary_text += str(summary) + "\n\n"
|
62 |
print("Summary:")
|