YAML Metadata
Warning:
The pipeline tag "text2text-generation" is not in the official list: text-classification, token-classification, table-question-answering, question-answering, zero-shot-classification, translation, summarization, feature-extraction, text-generation, fill-mask, sentence-similarity, text-to-speech, text-to-audio, automatic-speech-recognition, audio-to-audio, audio-classification, audio-text-to-text, voice-activity-detection, depth-estimation, image-classification, object-detection, image-segmentation, text-to-image, image-to-text, image-to-image, image-to-video, unconditional-image-generation, video-classification, reinforcement-learning, robotics, tabular-classification, tabular-regression, tabular-to-text, table-to-text, multiple-choice, text-ranking, text-retrieval, time-series-forecasting, text-to-video, image-text-to-text, image-text-to-image, image-text-to-video, visual-question-answering, document-question-answering, zero-shot-image-classification, graph-ml, mask-generation, zero-shot-object-detection, text-to-3d, image-to-3d, image-feature-extraction, video-text-to-text, keypoint-detection, visual-document-retrieval, any-to-any, video-to-video, other
Den4ikAI/FRED-T5-XL_instructor
Инструкционная модель на FRED-T5-XL.
Пример использования
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
import torch
use_cuda = torch.cuda.is_available()
device = torch.device("cuda" if use_cuda else "cpu")
tokenizer = AutoTokenizer.from_pretrained("Den4ikAI/FRED-T5-XL_instructor")
model = AutoModelForSeq2SeqLM.from_pretrained("Den4ikAI/FRED-T5-XL_instructor", torch_dtype=torch.float16).to(device)
model.eval()
from transformers import GenerationConfig
generation_config = GenerationConfig.from_pretrained("Den4ikAI/FRED-T5-XL_instructor")
def generate(prompt):
data = tokenizer(f"<SC6>Человек: {prompt}\nБот: <extra_id_0>", return_tensors="pt").to(model.device)
output_ids = model.generate(
**data,
generation_config=generation_config
)[0]
out = tokenizer.decode(output_ids.tolist())
return out
while 1:
print(generate(input(":> ")))
Citation
@MISC{Den4ikAI/FRED-T5-XL_instructor,
author = {Denis Petrov},
title = {Russian Instructor Model},
url = {https://huggingface.co/Den4ikAI/FRED-T5-XL_instructor/},
year = 2023
}
- Downloads last month
- 16