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")# 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") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- 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 files
README.md
CHANGED
|
@@ -11,6 +11,8 @@ pipeline_tag: text2text-generation
|
|
| 11 |
- Input: `context` (e.g. news article)
|
| 12 |
- Output: `question <sep> answer`
|
| 13 |
|
|
|
|
|
|
|
| 14 |
## Model Details
|
| 15 |
|
| 16 |
t5-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),
|
|
@@ -18,7 +20,7 @@ or please refer to the GitHub repo of this project: https://github.com/potsawee/
|
|
| 18 |
|
| 19 |
## How to Use the Model
|
| 20 |
|
| 21 |
-
Use the code below to get started with the model.
|
| 22 |
|
| 23 |
```python
|
| 24 |
>>> from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
|
|
|
| 11 |
- Input: `context` (e.g. news article)
|
| 12 |
- Output: `question <sep> answer`
|
| 13 |
|
| 14 |
+
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.
|
| 15 |
+
|
| 16 |
## Model Details
|
| 17 |
|
| 18 |
t5-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),
|
|
|
|
| 20 |
|
| 21 |
## How to Use the Model
|
| 22 |
|
| 23 |
+
Use the code below to get started with the model. You can also set do_sample=True in generate() to obtain different question-answer pairs.
|
| 24 |
|
| 25 |
```python
|
| 26 |
>>> from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|