đ FLAN - T5 Math Question - Answering Model
A FLAN - T5 model trained on arxiv math question - answering data for research purposes.
đ Quick Start
This is a FLAN - T5 model trained on [ArtifactAI/arxiv - math - instruct - 50k](https://huggingface.co/datasets/ArtifactAI/arxiv - math - instruct - 50k). It's for research only and should not be used in production settings as the output is highly unreliable.
⨠Features
- Model Type: Language model
- Language: English
- License: Apache 2.0
- Related Models: [All FLAN - T5 Checkpoints](https://huggingface.co/models?search=flan - t5)
đĻ Installation
No specific installation steps are provided in the original README. If you want to use the model, you need to install the transformers
library and other necessary dependencies according to the usage examples.
đģ Usage Examples
Basic Usage
Running the model on a CPU
from transformers import T5Tokenizer, T5ForConditionalGeneration
tokenizer = T5Tokenizer.from_pretrained("ArtifactAI/flan-t5-base-arxiv-math-question-answering")
model = T5ForConditionalGeneration.from_pretrained("ArtifactAI/flan-t5-base-arxiv-math-question-answering")
input_text = "What is the spectral isolation of bi-invariant metrics?"
input_ids = tokenizer(input_text, return_tensors="pt").input_ids
outputs = model.generate(input_ids)
print(tokenizer.decode(outputs[0]))
Running the model on a GPU
from transformers import T5Tokenizer, T5ForConditionalGeneration
tokenizer = T5Tokenizer.from_pretrained("ArtifactAI/flan-t5-base-arxiv-math-question-answering")
model = T5ForConditionalGeneration.from_pretrained("ArtifactAI/flan-t5-base-arxiv-math-question-answering", device_map="auto")
input_text = "What is the spectral isolation of bi-invariant metrics?"
input_ids = tokenizer(input_text, return_tensors="pt").input_ids.to("cuda")
outputs = model.generate(input_ids)
print(tokenizer.decode(outputs[0]))
Advanced Usage
Running the model in an HF pipeline (FP16)
qa = pipeline("summarization", model="ArtifactAI/flan-t5-base-arxiv-math-question-answering")
query = "What is the spectral isolation of bi-invariant metrics?"
print(f"query: {query}")
res = qa("answer: " + query)
print(f"{res[0]['summary_text']}")
đ Documentation
Training Details
Training Data
The model was trained on [ArtifactAI/arxiv - math - instruct - 50k](https://huggingface.co/datasets/ArtifactAI/arxiv - math - instruct - 50k), a dataset of question/answer pairs. Questions are generated using the t5 - base model, while the answers are generated using the GPT - 3.5 - turbo model.
đ License
This model is licensed under the Apache 2.0 license.
đ Citation
@misc{flan-t5-base-arxiv-math-question-answering,
title={flan-t5-base-arxiv-math-question-answering},
author={Matthew Kenney},
year={2023}
}