Instructions to use lytang/MiniCheck-Flan-T5-Large with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lytang/MiniCheck-Flan-T5-Large with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="lytang/MiniCheck-Flan-T5-Large")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("lytang/MiniCheck-Flan-T5-Large") model = AutoModelForSeq2SeqLM.from_pretrained("lytang/MiniCheck-Flan-T5-Large", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Liyan06 commited on
Commit ·
67a6912
1
Parent(s): 09efa05
handle small chunk size
Browse files
minicheck_web/inference.py
CHANGED
|
@@ -104,6 +104,8 @@ class Inferencer():
|
|
| 104 |
|
| 105 |
doc_chunks = [chunk.replace(" \n ", '\n').strip() for chunk in chunks(doc_sents, self.chunk_size)]
|
| 106 |
|
|
|
|
|
|
|
| 107 |
'''
|
| 108 |
[chunk_1, chunk_2, chunk_3, chunk_4, ...]
|
| 109 |
[claim]
|
|
|
|
| 104 |
|
| 105 |
doc_chunks = [chunk.replace(" \n ", '\n').strip() for chunk in chunks(doc_sents, self.chunk_size)]
|
| 106 |
|
| 107 |
+
doc_chunks = [chunk for chunk in doc_chunks if chunk != ''] # this should be added to the real code to remove empty chunks
|
| 108 |
+
|
| 109 |
'''
|
| 110 |
[chunk_1, chunk_2, chunk_3, chunk_4, ...]
|
| 111 |
[claim]
|