# Den4ikAI/FRED-T5-XL-chitchat
Болталка на основе FRED-T5-XL. Длина контекста модели 6-8 реплик.

# Пример использования
```python
import torch
import transformers

use_cuda = torch.cuda.is_available()
device = torch.device("cuda" if use_cuda else "cpu")


t5_tokenizer = transformers.GPT2Tokenizer.from_pretrained("Den4ikAI/FRED-T5-XL-chitchat")
t5_model = transformers.T5ForConditionalGeneration.from_pretrained("Den4ikAI/FRED-T5-XL-chitchat")

while True:
    print('-'*80)
    dialog = []
    while True:
        msg = input('H:> ').strip()
        if len(msg) == 0:
            break

        dialog.append('- ' + msg)
        dialog.append('- <extra_id_0>')
        input_ids = t5_tokenizer('<SC1>'+'\n'.join(dialog), return_tensors='pt').input_ids
        out_ids = t5_model.generate(input_ids=input_ids,
                                    max_length=200,
                                    eos_token_id=t5_tokenizer.eos_token_id,
                                    early_stopping=True,
                                    do_sample=True,
                                    temperature=1.0,
                                    top_k=0,
                                    top_p=0.85)
        dialog.pop(-1)
        t5_output = t5_tokenizer.decode(out_ids[0][1:]).replace('<extra_id_0>','')
        if '</s>' in t5_output:
            t5_output = t5_output[:t5_output.find('</s>')].strip()

        print('B:> {}'.format(t5_output))
        dialog.append('- '+t5_output)
```
# Citation
```
@MISC{Den4ikAI/FRED-T5-XL-chitchat,
    author  = {Denis Petrov},
    title   = {Russian chitchat model},
    url     = {https://huggingface.co/Den4ikAI/FRED-T5-XL-chitchat},
    year    = 2023
}
```

{"language": ["ru"], "license": "mit", "pipeline_tag": "text2text-generation", "widget": [{"text": "<SC1>- \u041a\u0430\u043a \u0442\u0435\u0431\u044f \u0437\u043e\u0432\u0443\u0442?\\n- \u0414\u0430\u0448\u0430\\n- \u0410 \u043c\u0435\u043d\u044f \u0414\u0435\u043d\u0438\u0441\\n- <extra_id_0>"}]}
transformers pytorch t5 text2text-generation ru license:mit autotrain_compatible endpoints_compatible text-generation-inference region:us
TAGS
#transformers #pytorch #t5 #text2text-generation #ru #license-mit #autotrain_compatible #endpoints_compatible #text-generation-inference #region-us 

# Den4ikAI/FRED-T5-XL-chitchat
Болталка на основе FRED-T5-XL. Длина контекста модели 6-8 реплик.

# Пример использования


# Den4ikAI/FRED-T5-XL-chitchat
Болталка на основе FRED-T5-XL. Длина контекста модели 6-8 реплик. # Пример использования
TAGS
#transformers #pytorch #t5 #text2text-generation #ru #license-mit #autotrain_compatible #endpoints_compatible #text-generation-inference #region-us 
 # Den4ikAI/FRED-T5-XL-chitchat
Болталка на основе FRED-T5-XL. Длина контекста модели 6-8 реплик. # Пример использования