Qwen3 8b Ru
Q
Qwen3 8b Ru
attn-signsによって開発
Qwen3-8Bをベースにしたロシア語最適化大規模言語モデル、ロシア語テキスト生成タスク専用設計
ダウンロード数 30
リリース時間 : 5/6/2025
モデル概要
Qwen3-8Bのファインチューン版、LoRAによる教師ありファインチューニングでロシア語テキスト生成能力を最適化、ロシア語と英語のバイリンガル処理をサポート
モデル特徴
ロシア語最適化
ロシア語テキスト生成タスク向けに特別最適化、ロシア語コーパスで優れた性能を発揮
効率的なファインチューニング
LoRA技術を採用したパラメータ効率的なファインチューニング、A100でわずか12時間のトレーニング
長文サポート
最大4096トークンのコンテキストウィンドウをサポート
マルチターン会話
組み込みの会話テンプレートで複雑なマルチターン会話シーンをサポート
モデル能力
ロシア語テキスト生成
英語テキスト生成
マルチターン会話処理
長文生成
使用事例
コンテンツ作成
ロシア語記事作成
ロシア語の言語習慣に合った長文記事を生成
流暢で自然なロシア語テキスト出力
技術サポート
ロシア語コードドキュメント生成
ロシア語開発者向けにコード説明ドキュメントを生成
専門的で正確なロシア語技術ドキュメント
🚀 Qwen3-8B-ru
- [EN]
Qwen3ベースのモデルで、ロシア語のテキスト生成タスクに適応されています。 - [RU]
Finetune版のQwen3で、ロシア語のテキスト生成に適応されています。
🚀 クイックスタート
このモデルは、Qwen3ベースでロシア語のテキスト生成タスクに適応されたモデルです。以下に使用例を示します。
✨ 主な機能
- Qwen3ベースのモデルで、ロシア語のテキスト生成タスクに適応。
- LoRAによる教師あり微調整(SFT)が行われています。
📦 インストール
このモデルを使用するには、transformers
ライブラリが必要です。以下のコマンドでインストールできます。
pip install transformers
💻 使用例
基本的な使用法
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "attn-signs/Qwen3-8B-ru"
# load the tokenizer and the model
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="auto",
device_map="auto"
)
# prepare the model input
prompt = "Give me a short introduction to large language model."
messages = [
{"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
enable_thinking=True # Switches between thinking and non-thinking modes. Default is True.
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
# conduct text completion
generated_ids = model.generate(
**model_inputs,
max_new_tokens=32768
)
output_ids = generated_ids[0][len(model_inputs.input_ids[0]):].tolist()
# parsing thinking content
try:
# rindex finding 151668 (</think>)
index = len(output_ids) - output_ids[::-1].index(151668)
except ValueError:
index = 0
thinking_content = tokenizer.decode(output_ids[:index], skip_special_tokens=True).strip("\n")
content = tokenizer.decode(output_ids[index:], skip_special_tokens=True).strip("\n")
print("thinking content:", thinking_content)
print("content:", content)
📚 ドキュメント
モデルの詳細
-
[EN]
LoRA supervised finetuning was performed on 2xA100 NVIDIA GPUs for 12h for 1 epoch on datasets:
attn-signs/kolmogorov-3;
attn-signs/russian-code; -
[RU]
LoRA SFTサイクルは、2つのNVIDIA A100で実行され、学習は約12時間続きました。
データセットの完全なエポックの実行:
attn-signs/kolmogorov-3;
attn-signs/russian-code;
モデルの説明
- 開発者: [Reisen Raumberg (Attention Signs team)]
- 言語 (NLP): [RU/EN]
- 微調整元のモデル: [Qwen3]
分散学習にはDeepSpeed (Stage 3)とHF.Accelerator、およびfused AdamWが使用されました。
GPU時間: NVIDIA A100で12時間
学習には、HuggingFace AcceleratorとMicrosoft DeepSpeed (Stage 3)を使用してパラメータとオプティマイザの状態を分散させ、fused AdamWも使用しました。
GPU時間: NVIDIA A100で12時間
モデルの設定
[model]
model_name_or_path = "Qwen/Qwen3-8B"
[datasets]
dataset = [
'attn-signs/kolmogorov-3',
'attn-signs/russian-code',
]
dataset_ratio = [
1,
1
]
test_size = 0.05
conversation_field = "conversation"
generate_eval_examples = false
evaluation_strategy = "steps"
eval_steps = 500
dataloader_num_workers = 2
remove_unused_columns = true
[run]
save_strategy = "steps"
save_steps = 500
save_total_limit = 3
run_name = "sft-qwen3-8b"
report_to = "wandb"
logging_first_step = true
logging_steps = 1
output_dir = "models/attn-signs-qwen3-8b"
project_name = "sft-qwen3"
[training]
train_only_on_completions = true
per_device_train_batch_size = 1
per_device_eval_batch_size = 1
num_train_epochs = 1
learning_rate = 0.00004
gradient_accumulation_steps = 8
gradient_checkpointing = true
warmup_steps = 10
bf16 = true
seed = 42
use_peft = true
max_length = 4096
[fusion]
use_liger = true
attn_implementation = "flash_attention_2"
[lora]
lora_target_modules = [
"k_proj",
"v_proj",
"q_proj",
"o_proj",
"gate_proj",
"up_proj",
"down_proj",
]
lora_r = 512
lora_alpha = 512
[tokenizer]
assistant_message_template = "<|im_start|>assistant"
pad_token = "<|endoftext|>"
eos_token = "<|im_end|>"
chat_template = "{%- if tools %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0].role == 'system' %}\n {{- messages[0].content + '\\n\\n' }}\n {%- endif %}\n {{- \"# Tools\\n\\nYou may call one or more functions to assist with the user query.\\n\\nYou are provided with function signatures within <tools></tools> XML tags:\\n<tools>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\n</tools>\\n\\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\\n<tool_call>\\n{\\\"name\\\": <function-name>, \\\"arguments\\\": <args-json-object>}\\n</tool_call><|im_end|>\\n\" }}\n{%- else %}\n {%- if messages[0].role == 'system' %}\n {{- '<|im_start|>system\\n' + messages[0].content + '<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}\n{%- for message in messages[::-1] %}\n {%- set index = (messages|length - 1) - loop.index0 %}\n {%- if ns.multi_step_tool and message.role == \"user\" and not(message.content.startswith('<tool_response>') and message.content.endswith('</tool_response>')) %}\n {%- set ns.multi_step_tool = false %}\n {%- set ns.last_query_index = index %}\n {%- endif %}\n{%- endfor %}\n{%- for message in messages %}\n {%- if (message.role == \"user\") or (message.role == \"system\" and not loop.first) %}\n {{- '<|im_start|>' + message.role + '\\n' + message.content + '<|im_end|>' + '\\n' }}\n {%- elif message.role == \"assistant\" %}\n {%- set content = message.content %}\n {%- set reasoning_content = '' %}\n {%- if message.reasoning_content is defined and message.reasoning_content is not none %}\n {%- set reasoning_content = message.reasoning_content %}\n {%- else %}\n {%- if '</think>' in message.content %}\n {%- set content = message.content.split('</think>')[-1].lstrip('\\n') %}\n {%- set reasoning_content = message.content.split('</think>')[0].rstrip('\\n').split('<think>')[-1].lstrip('\\n') %}\n {%- endif %}\n {%- endif %}\n {%- if loop.index0 > ns.last_query_index %}\n {%- if loop.last or (not loop.last and reasoning_content) %}\n {{- '<|im_start|>' + message.role + '\\n<think>\\n' + reasoning_content.strip('\\n') + '\\n</think>\\n\\n' + content.lstrip('\\n') }}\n {%- else %}\n {{- '<|im_start|>' + message.role + '\\n' + content }}\n {%- endif %}\n {%- else %}\n {{- '<|im_start|>' + message.role + '\\n' + content }}\n {%- endif %}\n {%- if message.tool_calls %}\n {%- for tool_call in message.tool_calls %}\n {%- if (loop.first and content) or (not loop.first) %}\n {{- '\\n' }}\n {%- endif %}\n {%- if tool_call.function %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {{- '<tool_call>\\n{\"name\": \"' }}\n {{- tool_call.name }}\n {{- '\", \"arguments\": ' }}\n {%- if tool_call.arguments is string %}\n {{- tool_call.arguments }}\n {%- else %}\n {{- tool_call.arguments | tojson }}\n {%- endif %}\n {{- '}\\n</tool_call>' }}\n {%- endfor %}\n {%- endif %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if loop.first or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {{- message.content }}\n {{- '\\n</tool_response>' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != \"tool\") %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n {%- if enable_thinking is defined and enable_thinking is false %}\n {{- '<think>\\n\\n</think>\\n\\n' }}\n {%- endif %}\n{%- endif %}"
📄 ライセンス
このモデルは、Apache-2.0ライセンスの下で提供されています。
Phi 2 GGUF
その他
Phi-2はマイクロソフトが開発した小型ながら強力な言語モデルで、27億のパラメータを持ち、効率的な推論と高品質なテキスト生成に特化しています。
大規模言語モデル 複数言語対応
P
TheBloke
41.5M
205
Roberta Large
MIT
マスク言語モデリングの目標で事前学習された大型英語言語モデルで、改良されたBERTの学習方法を採用しています。
大規模言語モデル 英語
R
FacebookAI
19.4M
212
Distilbert Base Uncased
Apache-2.0
DistilBERTはBERT基礎モデルの蒸留バージョンで、同等の性能を維持しながら、より軽量で高効率です。シーケンス分類、タグ分類などの自然言語処理タスクに適しています。
大規模言語モデル 英語
D
distilbert
11.1M
669
Llama 3.1 8B Instruct GGUF
Meta Llama 3.1 8B Instructは多言語大規模言語モデルで、多言語対話ユースケースに最適化されており、一般的な業界ベンチマークで優れた性能を発揮します。
大規模言語モデル 英語
L
modularai
9.7M
4
Xlm Roberta Base
MIT
XLM - RoBERTaは、100言語の2.5TBのフィルタリングされたCommonCrawlデータを使って事前学習された多言語モデルで、マスク言語モデリングの目標で学習されています。
大規模言語モデル 複数言語対応
X
FacebookAI
9.6M
664
Roberta Base
MIT
Transformerアーキテクチャに基づく英語の事前学習モデルで、マスク言語モデリングの目標を通じて大量のテキストでトレーニングされ、テキスト特徴抽出と下流タスクの微調整をサポートします。
大規模言語モデル 英語
R
FacebookAI
9.3M
488
Opt 125m
その他
OPTはMeta AIが公開したオープンプリトレーニングトランスフォーマー言語モデルスイートで、パラメータ数は1.25億から1750億まであり、GPT-3シリーズの性能に対抗することを目指しつつ、大規模言語モデルのオープンな研究を促進するものです。
大規模言語モデル 英語
O
facebook
6.3M
198
1
transformersライブラリに基づく事前学習モデルで、様々なNLPタスクに適用可能
大規模言語モデル
Transformers

1
unslothai
6.2M
1
Llama 3.1 8B Instruct
Llama 3.1はMetaが発表した多言語大規模言語モデルシリーズで、8B、70B、405Bのパラメータ規模を持ち、8種類の言語とコード生成をサポートし、多言語対話シーンを最適化しています。
大規模言語モデル
Transformers 複数言語対応

L
meta-llama
5.7M
3,898
T5 Base
Apache-2.0
T5ベーシック版はGoogleによって開発されたテキスト-to-テキスト変換Transformerモデルで、パラメータ規模は2.2億で、多言語NLPタスクをサポートしています。
大規模言語モデル 複数言語対応
T
google-t5
5.4M
702
おすすめAIモデル
Llama 3 Typhoon V1.5x 8b Instruct
タイ語専用に設計された80億パラメータの命令モデルで、GPT-3.5-turboに匹敵する性能を持ち、アプリケーションシナリオ、検索拡張生成、制限付き生成、推論タスクを最適化
大規模言語モデル
Transformers 複数言語対応

L
scb10x
3,269
16
Cadet Tiny
Openrail
Cadet-TinyはSODAデータセットでトレーニングされた超小型対話モデルで、エッジデバイス推論向けに設計されており、体積はCosmo-3Bモデルの約2%です。
対話システム
Transformers 英語

C
ToddGoldfarb
2,691
6
Roberta Base Chinese Extractive Qa
RoBERTaアーキテクチャに基づく中国語抽出型QAモデルで、与えられたテキストから回答を抽出するタスクに適しています。
質問応答システム 中国語
R
uer
2,694
98