Views
No views yet
transformers library's pipeline feature.1from transformers import pipeline
2
3# Load the pretrained model for inference
4model = pipeline("text2text-generation", model="nsu-intellisphere/t5-small-ctx-qgen")
5
6# Example usage
7context = "According to their estimates the universe is 13.7 billion years old with an uncertainty of 200 million years."
8question = model(context)[0]['generated_text']
9
10print(f'Context: {context}')
11print(f'Question: {question}')