Text Generation
Transformers
Safetensors
English
llama
text-generation-inference
unsloth
trl
4-bit precision
bitsandbytes
Instructions to use kazuHF/llm-jp-3-13b-it2_lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kazuHF/llm-jp-3-13b-it2_lora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="kazuHF/llm-jp-3-13b-it2_lora")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("kazuHF/llm-jp-3-13b-it2_lora") model = AutoModelForCausalLM.from_pretrained("kazuHF/llm-jp-3-13b-it2_lora") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use kazuHF/llm-jp-3-13b-it2_lora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "kazuHF/llm-jp-3-13b-it2_lora" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kazuHF/llm-jp-3-13b-it2_lora", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/kazuHF/llm-jp-3-13b-it2_lora
- SGLang
How to use kazuHF/llm-jp-3-13b-it2_lora with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "kazuHF/llm-jp-3-13b-it2_lora" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kazuHF/llm-jp-3-13b-it2_lora", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "kazuHF/llm-jp-3-13b-it2_lora" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kazuHF/llm-jp-3-13b-it2_lora", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Unsloth Studio
How to use kazuHF/llm-jp-3-13b-it2_lora with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for kazuHF/llm-jp-3-13b-it2_lora to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for kazuHF/llm-jp-3-13b-it2_lora to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for kazuHF/llm-jp-3-13b-it2_lora to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="kazuHF/llm-jp-3-13b-it2_lora", max_seq_length=2048, ) - Docker Model Runner
How to use kazuHF/llm-jp-3-13b-it2_lora with Docker Model Runner:
docker model run hf.co/kazuHF/llm-jp-3-13b-it2_lora
Update README.md
Browse files
README.md
CHANGED
|
@@ -22,7 +22,7 @@ This llama model was trained 2x faster with [Unsloth](https://github.com/unsloth
|
|
| 22 |
[<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
|
| 23 |
|
| 24 |
|
| 25 |
-
# kazuHF/llm-jp-3-13b-it2_loraの概要
|
| 26 |
|
| 27 |
1. モデル概要
|
| 28 |
- ベースモデル: llm-jp/llm-jp-3-13b (https://huggingface.co/llm-jp/llm-jp-3-13b)
|
|
@@ -55,9 +55,9 @@ This llama model was trained 2x faster with [Unsloth](https://github.com/unsloth
|
|
| 55 |
- 東京大学 松尾・岩澤研究室主催の大規模言語モデルDeep Learning応用講座 2024|Fall を受講することで本モデルが作製できた。同講座に関係する方々並びに同講座を受講された方々に心より深謝する。
|
| 56 |
|
| 57 |
|
| 58 |
-
# 推論方法の詳細
|
| 59 |
|
| 60 |
-
◆ Google Colaboratory上の
|
| 61 |
|
| 62 |
1. Google Colaboratory上で、サンプルコードの
|
| 63 |
Model_Inference_Template_20241127.jpynb
|
|
@@ -86,14 +86,14 @@ This llama model was trained 2x faster with [Unsloth](https://github.com/unsloth
|
|
| 86 |
14. 推論結果をjsonlで保存。
|
| 87 |
|
| 88 |
|
| 89 |
-
#
|
| 90 |
|
| 91 |
-
|
| 92 |
|
| 93 |
1. 自身のHugging Faceにlog inし、自身のProfileのSettingに入り、Access Tokenに入る。
|
| 94 |
2. Create New Tokenをクリックし、Token type からWriteを選択し、Token nameを設定してから、Create tokenをクリックする。tokenを保存しておく。
|
| 95 |
|
| 96 |
-
|
| 97 |
|
| 98 |
1. LLMのための日本語インストラクションデータ公開ページに入る。( https://liat-aip.sakura.ne.jp/wp/llm%e3%81%ae%e3%81%9f%e3%82%81%e3%81%ae%e6%97%a5%e6%9c%ac%e8%aa%9e%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%a9%e3%82%af%e3%82%b7%e3%83%a7%e3%83%b3%e3%83%87%e3%83%bc%e3%82%bf%e4%bd%9c%e6%88%90/llm%e3%81%ae%e3%81%9f%e3%82%81%e3%81%ae%e6%97%a5%e6%9c%ac%e8%aa%9e%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%a9%e3%82%af%e3%82%b7%e3%83%a7%e3%83%b3%e3%83%87%e3%83%bc%e3%82%bf-%e5%85%ac%e9%96%8b/ )
|
| 99 |
2. ダウンロードのための必要事項記入フォームに記入。(https://docs.google.com/forms/d/1CeYoFrMJnCFbH71RGxOaAIDGDBofUSAEdEcmiLR-Uko/viewform?edit_requested=true)
|
|
@@ -103,7 +103,7 @@ https://drive.google.com/file/d/1U_GQ43hc2EYTKO-gvswooR0UY12alB0z/view?usp=drive
|
|
| 103 |
ichikara-instruction-003-001-1.json
|
| 104 |
などのjsonファイルのデータが入手できる。これをモデルの事後学習であるSFTやRLHFのための学習データとして利用する。
|
| 105 |
|
| 106 |
-
◆ Google Colaboratory上の
|
| 107 |
|
| 108 |
1. Google Colaboratory上で、サンプルコードの
|
| 109 |
LoRA_template_unsloth_20241127.jpynb
|
|
|
|
| 22 |
[<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
|
| 23 |
|
| 24 |
|
| 25 |
+
# ■ kazuHF/llm-jp-3-13b-it2_loraの概要
|
| 26 |
|
| 27 |
1. モデル概要
|
| 28 |
- ベースモデル: llm-jp/llm-jp-3-13b (https://huggingface.co/llm-jp/llm-jp-3-13b)
|
|
|
|
| 55 |
- 東京大学 松尾・岩澤研究室主催の大規模言語モデルDeep Learning応用講座 2024|Fall を受講することで本モデルが作製できた。同講座に関係する方々並びに同講座を受講された方々に心より深謝する。
|
| 56 |
|
| 57 |
|
| 58 |
+
# ■ 推論方法の詳細
|
| 59 |
|
| 60 |
+
◆ Google Colaboratory上のGPUで推論する場合
|
| 61 |
|
| 62 |
1. Google Colaboratory上で、サンプルコードの
|
| 63 |
Model_Inference_Template_20241127.jpynb
|
|
|
|
| 86 |
14. 推論結果をjsonlで保存。
|
| 87 |
|
| 88 |
|
| 89 |
+
# ■ 事後学習の詳細
|
| 90 |
|
| 91 |
+
◇ Hugging Faceでwrite権限のあるtokenの取得
|
| 92 |
|
| 93 |
1. 自身のHugging Faceにlog inし、自身のProfileのSettingに入り、Access Tokenに入る。
|
| 94 |
2. Create New Tokenをクリックし、Token type からWriteを選択し、Token nameを設定してから、Create tokenをクリックする。tokenを保存しておく。
|
| 95 |
|
| 96 |
+
◇ 事後学習のためのデータの入手
|
| 97 |
|
| 98 |
1. LLMのための日本語インストラクションデータ公開ページに入る。( https://liat-aip.sakura.ne.jp/wp/llm%e3%81%ae%e3%81%9f%e3%82%81%e3%81%ae%e6%97%a5%e6%9c%ac%e8%aa%9e%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%a9%e3%82%af%e3%82%b7%e3%83%a7%e3%83%b3%e3%83%87%e3%83%bc%e3%82%bf%e4%bd%9c%e6%88%90/llm%e3%81%ae%e3%81%9f%e3%82%81%e3%81%ae%e6%97%a5%e6%9c%ac%e8%aa%9e%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%a9%e3%82%af%e3%82%b7%e3%83%a7%e3%83%b3%e3%83%87%e3%83%bc%e3%82%bf-%e5%85%ac%e9%96%8b/ )
|
| 99 |
2. ダウンロードのための必要事項記入フォームに記入。(https://docs.google.com/forms/d/1CeYoFrMJnCFbH71RGxOaAIDGDBofUSAEdEcmiLR-Uko/viewform?edit_requested=true)
|
|
|
|
| 103 |
ichikara-instruction-003-001-1.json
|
| 104 |
などのjsonファイルのデータが入手できる。これをモデルの事後学習であるSFTやRLHFのための学習データとして利用する。
|
| 105 |
|
| 106 |
+
◆ Google Colaboratory上のGPUでの事後学習
|
| 107 |
|
| 108 |
1. Google Colaboratory上で、サンプルコードの
|
| 109 |
LoRA_template_unsloth_20241127.jpynb
|