ArXiv
Collection
Models and datasets for use with ArXiv data
•
32 items
•
Updated
•
1
This is a FLAN-T5 model trained on ArtifactAI/arxiv-math-instruct-50k. This model is for research purposes only and should not be used in production settings. The output it highly unreliable.
Find below some example scripts on how to use the model in transformers
:
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]))
# pip install accelerate
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]))
# load model and tokenizer from huggingface hub with pipeline
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']}")
The model was trained on 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.
@misc{flan-t5-base-arxiv-math-question-answering,
title={flan-t5-base-arxiv-math-question-answering},
author={Matthew Kenney},
year={2023}
}