Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Magpieという手法とNemotron-4-340B-Instructを用いて合成対話データセットを作るコード

License

NotificationsYou must be signed in to change notification settings

Aratako/magpie-nemotron

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Magpieという手法と、DeepInfra上のnvidia/Nemotron-4-340B-Instructを使用して、合成対話データセットを生成するためのコードです。

概要

Magpieは、既存の大規模言語モデル(LLM)を使用して、高品質な指示データを大量に合成する手法です。

このコードは以下の論文に基づいています:

Lin, B. Y., et al. (2024). "Magpie: Alignment Data Synthesis from Scratch by Prompting Aligned LLMs with Nothing". arXiv preprint arXiv:2406.08464.

使用方法

  1. 必要なライブラリをインストールします。

    pip install -r requirements.txt
  2. DeepInfraのサービスよりAPIキーを取得します。

  3. 以下のようなコマンドを実行してデータセットを生成します。

    python generate_dataset.py --api_key YOUR_API_KEY_HERE --target_count 1000 --num_turns 3 --max_workers 50 --user_max_tokens 256 --assistant_max_tokens 1024 --temperature 1.0 --output_file generated_conversations.jsonl

    パラメータの説明:

    • --api_key: DeepInfra APIキー(必須)
    • --target_count: 生成するデータの数(デフォルト: 1000)
    • --num_turns: 各データのターン数(デフォルト: 3)
    • --max_workers: 並行処理で使用するワーカー数(デフォルト: 50)
    • --user_max_tokens: 指示の最大トークン数(デフォルト: 256)
    • --assistant_max_tokens: 応答の最大トークン数(デフォルト: 1024)
    • --temperature: 生成の温度(デフォルト: 1.0)
    • --output_file: 出力ファイル名(デフォルト: generated_conversations.jsonl)
    • --system_prompt: システムプロンプト(デフォルト: 以下の難易度の高い質問に日本語で答えてください。)
  4. 生成されたデータセットは指定した出力ファイル(デフォルトではgenerated_conversations.jsonl)に保存されます。

注意事項

  • このコードはNemotron-4-340B-Instructの使用を前提としています。他のモデルを使用する場合は、コードの一部を変更する必要があります。
  • DeepInfra以外で推論させる場合、コードの一部を変更する必要があります。
  • 大量のデータを生成する場合は、APIの使用制限と料金に注意してください。
  • 生成されたデータセットの品質と内容を必ず確認し、必要に応じてフィルタリングを行ってください。

ライセンス

このプロジェクトはMITライセンスの下で公開されています。

About

Magpieという手法とNemotron-4-340B-Instructを用いて合成対話データセットを作るコード

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp