How to use from
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 "Aratako/Oumuamua-7b-instruct-v2-RP" \
    --host 0.0.0.0 \
    --port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
	-H "Content-Type: application/json" \
	--data '{
		"model": "Aratako/Oumuamua-7b-instruct-v2-RP",
		"messages": [
			{
				"role": "user",
				"content": "What is the capital of France?"
			}
		]
	}'
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 "Aratako/Oumuamua-7b-instruct-v2-RP" \
        --host 0.0.0.0 \
        --port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
	-H "Content-Type: application/json" \
	--data '{
		"model": "Aratako/Oumuamua-7b-instruct-v2-RP",
		"messages": [
			{
				"role": "user",
				"content": "What is the capital of France?"
			}
		]
	}'
Quick Links

Oumuamua-7b-instruct-v2-RP

nitky/Oumuamua-7b-instruct-v2をロールプレイ用にLoRAでファインチューニングしたモデルです。

プロンプトフォーマット

以下のようなchat templateを利用してください。(Alpacaの改変版)

{ロールプレイの指示、世界観・あらすじの説明、キャラの設定など}

### 入力:
こんにちは。

### 応答:
こんにちは!</s>

### 入力:
今日はいい天気ですね。

### 応答:

また、マルチターンの対話を行う場合、各ターンのアシスタントの応答の末尾にeos tokenを必ずつけてください。

学習の設定

RunpodでGPUサーバを借り、A6000x4で学習を行いました。学習データをクオリティの高いものと低いものに2分し、2段階に分けて学習しています。

1回目の学習

まず、比較的クオリティの低いデータセットで1回学習を行いました。 利用データセットは以下の通りです。

学習パラメータは以下の通りです。

  • lora_r: 128
  • lisa_alpha: 256
  • lora_dropout: 0.05
  • lora_target_modules: ["q_proj", "k_proj", "v_proj", "o_proj", "gate_proj", "up_proj", "down_proj", "lm_head"]
  • learning_rate: 2e-5
  • num_train_epochs: 1 epoch
  • batch_size: 32
  • max_seq_length: 4096

2回目の学習

次に、クオリティの高いデータセットで学習を行いました。この2回目の学習は、completion onlyな学習ではなく、instruction部分もloss計算に入れる手法を取り入れています。また、事前学習で使われるようなinstruction形式ではないデータセットも全体の20%程度混ぜています。 利用データセットは以下の通りです。

学習パラメータは以下の通りです。

  • lora_r: 128
  • lisa_alpha: 256
  • lora_dropout: 0.05
  • lora_target_modules: ["q_proj", "k_proj", "v_proj", "o_proj", "gate_proj", "up_proj", "down_proj", "lm_head"]
  • learning_rate: 2e-5
  • num_train_epochs: 3 epochs
  • batch_size: 32
  • max_seq_length: 4096
Downloads last month
16
Safetensors
Model size
7B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Aratako/Oumuamua-7b-instruct-v2-RP

Quantizations
1 model

Datasets used to train Aratako/Oumuamua-7b-instruct-v2-RP