Commit
•
ba5a953
1
Parent(s):
6bffc77
Update README.md
Browse files
README.md
CHANGED
@@ -84,19 +84,14 @@ The following hyperparameters were used during training:
|
|
84 |
|
85 |
### How to use model
|
86 |
```py
|
87 |
-
from transformers import pipeline
|
88 |
-
from random import randrange
|
89 |
-
|
90 |
|
91 |
-
|
92 |
-
|
|
|
|
|
93 |
|
94 |
-
|
95 |
-
print(f"dialogue: \n{sample['dialogue']}\n---------------")
|
96 |
-
|
97 |
-
res = summarizer(sample["dialogue"])
|
98 |
-
|
99 |
-
print(f"flan-t5-base summary:\n{res[0]['summary_text']}")
|
100 |
|
101 |
result = summarize('''Hannah: Hey, do you have Betty's number?
|
102 |
Amanda: Lemme check
|
|
|
84 |
|
85 |
### How to use model
|
86 |
```py
|
87 |
+
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, pipeline
|
|
|
|
|
88 |
|
89 |
+
ckpt = 'sharmax-vikas/flan-t5-base-samsum'
|
90 |
+
tokenizer = AutoTokenizer.from_pretrained(ckpt)
|
91 |
+
# Use AutoModelForSeq2SeqLM for text generation tasks like summarization
|
92 |
+
model = AutoModelForSeq2SeqLM.from_pretrained(ckpt)
|
93 |
|
94 |
+
summarize = pipeline('summarization', tokenizer=tokenizer, model=model)
|
|
|
|
|
|
|
|
|
|
|
95 |
|
96 |
result = summarize('''Hannah: Hey, do you have Betty's number?
|
97 |
Amanda: Lemme check
|