Instructions to use potsawee/t5-large-generation-race-QuestionAnswer with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use potsawee/t5-large-generation-race-QuestionAnswer with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="potsawee/t5-large-generation-race-QuestionAnswer")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("potsawee/t5-large-generation-race-QuestionAnswer") model = AutoModelForSeq2SeqLM.from_pretrained("potsawee/t5-large-generation-race-QuestionAnswer", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use potsawee/t5-large-generation-race-QuestionAnswer with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "potsawee/t5-large-generation-race-QuestionAnswer" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "potsawee/t5-large-generation-race-QuestionAnswer", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/potsawee/t5-large-generation-race-QuestionAnswer
- SGLang
How to use potsawee/t5-large-generation-race-QuestionAnswer with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "potsawee/t5-large-generation-race-QuestionAnswer" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "potsawee/t5-large-generation-race-QuestionAnswer", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "potsawee/t5-large-generation-race-QuestionAnswer" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "potsawee/t5-large-generation-race-QuestionAnswer", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use potsawee/t5-large-generation-race-QuestionAnswer with Docker Model Runner:
docker model run hf.co/potsawee/t5-large-generation-race-QuestionAnswer
Update README.md
Browse files10 unmodified lines1112131415161 unmodified line1819202122232410 unmodified lines- Input: `context` (e.g. news article)- Output: `question <sep> answer`## Model Detailst5-large model is fine-tuned to the RACE dataset where the input is the context/passage and the output is the question followed by the answer. This is the first component in the question generation pipeline (i.e. `g1`) in our [MQAG paper](https://arxiv.org/abs/2301.12307),1 unmodified line## How to Use the ModelUse the code below to get started with the model.```python>>> from transformers import AutoTokenizer, AutoModelForSeq2SeqLM10 unmodified lines11121314151617181 unmodified line2021222324252610 unmodified lines- Input: `context` (e.g. news article)- Output: `question <sep> answer`This model generates **abstractive** answers following the RACE dataset. If you would like to have **extractive** questions/answers, you can use our model trained on SQuAD: https://huggingface.co/potsawee/t5-large-generation-squad-QuestionAnswer.## Model Detailst5-large model is fine-tuned to the RACE dataset where the input is the context/passage and the output is the question followed by the answer. This is the first component in the question generation pipeline (i.e. `g1`) in our [MQAG paper](https://arxiv.org/abs/2301.12307),1 unmodified line## How to Use the ModelUse the code below to get started with the model. You can also set do_sample=True in generate() to obtain different question-answer pairs.```python>>> from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
README.md+3-1