---
title: t5-small-next-word-generator-qoogle
canonical_url: "https://www.modelscope.cn/models/LLM-Research/t5-small-next-word-generator-qoogle"
md_url: "https://www.modelscope.cn/models/LLM-Research/t5-small-next-word-generator-qoogle.md"
repository: LLM-Research/t5-small-next-word-generator-qoogle
last_updated: 2024-11-21
pipeline_tag: text2text-generation
tasks:
  - text2text-generation
model_type:
  - t5
architectures:
  - T5ForConditionalGeneration
library_name:
  - transformer
  - pytorch
frameworks:
  - pytorch
language:
  - en
downloads: 2174
stars: 0
---

# t5-small-next-word-generator-qoogle

> t5-small-next-word-generator-qoogle - LLM-Research 在 ModelScope 开源的模型。Next word generator trained on questions. Receives partial questions and tries to predict the next word. Example use:

- **Repository**: LLM-Research/t5-small-next-word-generator-qoogle
- **Tasks**: text2text-generation
- **Downloads**: 2174
- **Stars**: 0
- **Last updated**: 2024-11-21

Source: https://www.modelscope.cn/models/LLM-Research/t5-small-next-word-generator-qoogle

---

Next word generator trained on questions. Receives partial questions and tries to predict the next word.
Example use: 

```python
from transformers import T5Config, T5ForConditionalGeneration, T5Tokenizer

model_name = "allenai/t5-small-next-word-generator-qoogle"
tokenizer = T5Tokenizer.from_pretrained(model_name)
model = T5ForConditionalGeneration.from_pretrained(model_name)

def run_model(input_string, **generator_args):
    input_ids = tokenizer.encode(input_string, return_tensors="pt")
    res = model.generate(input_ids, **generator_args)
    output = tokenizer.batch_decode(res, skip_special_tokens=True)
    print(output)
    return output


run_model("Which")
run_model("Which two")
run_model("Which two counties")
run_model("Which two counties are")
run_model("Which two counties are the")
run_model("Which two counties are the biggest")
run_model("Which two counties are the biggest economic")
run_model("Which two counties are the biggest economic powers")

```
which should result in the following:
```
['one']
['statements']
['are']
['in']
['most']
['in']
['zones']
['of']
```
