🚀 Mistral-7B-Instruct-Ukrainianのモデルカード
Mistral-7B-UKは、ウクライナ語向けにファインチューニングされた大規模言語モデルです。
Mistral-7B-UKは、以下の手順で学習されています。
- Mistral-7B-v0.2を構造化および非構造化データセットを用いて初期ファインチューニング。
- ファインチューニングされたモデルと、
OpenLLM
ベンチマークでMistral-7B-v0.2
よりも優れた性能を発揮するモデルNeuralTrix-7BをSLERPマージ。
- 最終モデルのDPO。
🚀 クイックスタート
指示書の形式
指示のファインチューニングを活用するには、プロンプトを[INST]
と[/INST]
トークンで囲む必要があります。
例:
text = "[INST]Відповідайте лише буквою правильної відповіді: Елементи експресіонізму наявні у творі: A. «Камінний хрест», B. «Інститутка», C. «Маруся», D. «Людина»[/INST]"
この形式は、apply_chat_template()
メソッドを介してチャットテンプレートとして利用できます。
モデルアーキテクチャ
この指示モデルは、Mistral-7B-v0.2をベースにしたトランスフォーマーモデルで、以下のアーキテクチャが採用されています。
- グループ化クエリアテンション
- スライディングウィンドウアテンション
- バイトフォールバックBPEトークナイザー
データセット - 構造化
データセット - 非構造化
データセット - DPO
💻 使用例
基本的な使用法
!pip install -qU transformers accelerate
from transformers import AutoTokenizer
import transformers
import torch
model = "SherlockAssistant/Mistral-7B-Instruct-Ukrainian"
messages = [{"role": "user", "content": "What is a large language model?"}]
tokenizer = AutoTokenizer.from_pretrained(model)
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
pipeline = transformers.pipeline(
"text-generation",
model=model,
torch_dtype=torch.bfloat16,
device_map="auto",
)
outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
print(outputs[0]["generated_text"])
📚 ドキュメント
引用
このモデルを研究で使用して論文を公開する場合は、以下のように引用していただけると助かります。
BIB
@inproceedings{boros-chivereanu-dumitrescu-purcaru-2024-llm-uk,
title = "Fine-tuning and Retrieval Augmented Generation for Question Answering using affordable Large Language Models",
author = "Boros, Tiberiu and Chivereanu, Radu and Dumitrescu, Stefan Daniel and Purcaru, Octavian",
booktitle = "Proceedings of the Third Ukrainian Natural Language Processing Workshop, LREC-COLING",
month = may,
year = "2024",
address = "Torino, Italy",
publisher = "European Language Resources Association",
}
APA
Boros, T., Chivereanu, R., Dumitrescu, S., & Purcaru, O. (2024). Fine-tuning and Retrieval Augmented Generation for Question Answering using affordable Large Language Models. In Proceedings of the Third Ukrainian Natural Language Processing Workshop, LREC-COLING. European Language Resources Association.
MLA
Boros, Tiberiu, Radu, Chivereanu, Stefan Daniel, Dumitrescu, Octavian, Purcaru. "Fine-tuning and Retrieval Augmented Generation for Question Answering using affordable Large Language Models." Proceedings of the Third Ukrainian Natural Language Processing Workshop, LREC-COLING. European Language Resources Association, 2024.
Chicago
Boros, Tiberiu, Radu, Chivereanu, Stefan Daniel, Dumitrescu, and Octavian, Purcaru. "Fine-tuning and Retrieval Augmented Generation for Question Answering using affordable Large Language Models." . In Proceedings of the Third Ukrainian Natural Language Processing Workshop, LREC-COLING. European Language Resources Association, 2024.
📄 ライセンス
このライブラリは、apache-2.0
ライセンスの下で提供されています。