How to use from
SGLangUse 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 "DataPilot/ArrowSmartPlus_3.6B_instruction" \
--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": "DataPilot/ArrowSmartPlus_3.6B_instruction",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'Quick Links
概要
「LOCAL AI HACKATHON」における、チームDataPilot,4つめの成果品です。Line社が開発した「japanese-large-lm-3.6b-instruction-sft」をウィキブックの内容をもとに中学、高校範囲にてファインチューニングを行いました。 それに加え、saldra/sakura_japanese_datasetでインストラクションチューニングを行いました。
how to use
#pip install transformer
#pip install pipline
#pip install protobu
#pip install accelerate
#pip install sentencepiece
#pip install torch
#以上6つをピップインストールしてください。
import torch
from transformers import AutoModelForSequenceClassification
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
model = AutoModelForCausalLM.from_pretrainedmodel = AutoModelForCausalLM.from_pretrained("DataPilot/ArrowSmartPlus_3.6B_instruction")
tokenizer = AutoTokenizer.from_pretrained("DataPilot/ArrowSmartPlus_3.6B_instruction")
generator = pipeline("text-generation", model=model, tokenizer=tokenizer, device=0)
torch.cuda.empty_cache()
input_text = """有機物とは"""
text = generator(
f"ユーザー: {input_text} システム: ",
max_length = 100,
do_sample = True,
temperature = 0.7,
top_p = 0.9,
top_k = 0,
repetition_penalty = 1.1,
num_beams = 1,
pad_token_id = tokenizer.pad_token_id,
num_return_sequences = 1,
)
print(text)
トークン化:
ユニグラム言語モデルとバイトフォールバックを備えたセンテンスピーストークナイザー(sentencepiece tokenizer)を使用します。日本語トークナイザーによる事前トークン化は適用されません。したがって、ユーザーは生の文をトークナイザーに直接フィードできます。
ライセンス:
当LLMはオープンソースソフトウェアです。詳しくは下記のリンクをご覧ください。 https://www.apache.org/licenses/LICENSE-2.0
謝辞:
機材を貸していただいた Witnessさん 、このような機会を与えてくださった さるどらさん 、その他助言を与えてくださった「ローカルLLMに向き合う会」のみなさま、そしてすべての関係者の皆様に感謝を申し上げます。
witnessさん: https://twitter.com/i_witnessed_it
さるどらさん: https://twitter.com/sald_ra
ローカルLLMに向き合う会: https://discord.com/invite/VuYCYkYaHK
- Downloads last month
- 7
Install from pip and serve model
# Install SGLang from pip: pip install sglang# Start the SGLang server: python3 -m sglang.launch_server \ --model-path "DataPilot/ArrowSmartPlus_3.6B_instruction" \ --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": "DataPilot/ArrowSmartPlus_3.6B_instruction", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'