flex_ai
0.42
Twitter(別名X)
from flex_ai import FlexAI
from openai import OpenAI
import time
# Initialize the Flex AI client
client = FlexAI ( api_key = "your_api_key_here" )
# Create dataset - for all datasets [here](https://docs.getflex.ai/quickstart#upload-your-first-dataset)
dataset = client . create_dataset (
"API Dataset New" ,
"instruction/train.jsonl" ,
"instruction/eval.jsonl"
)
# Start a fine-tuning task
task = client . create_finetune (
name = "My Task New" ,
dataset_id = dataset [ "id" ],
model = "meta-llama/Llama-3.2-1B-Instruct" ,
n_epochs = 5 ,
train_with_lora = True ,
lora_config = {
"lora_r" : 64 ,
"lora_alpha" : 8 ,
"lora_dropout" : 0.1
},
n_checkpoints_and_evaluations_per_epoch = 1 ,
batch_size = 4 ,
learning_rate = 0.0001 ,
save_only_best_checkpoint = True
)
# Wait for training completion
client . wait_for_task_completion ( task_id = task [ "id" ])
# Wait for last checkpoint to be uploaded
while True :
checkpoints = client . get_task_checkpoints ( task_id = task [ "id" ])
if checkpoints and checkpoints [ - 1 ][ "stage" ] == "FINISHED" :
last_checkpoint = checkpoints [ - 1 ]
checkpoint_list = [{
"id" : last_checkpoint [ "id" ],
"name" : "step_" + str ( last_checkpoint [ "step" ])
}]
break
time . sleep ( 10 ) # Wait 10 seconds before checking again
# Create endpoint
endpoint_id = client . create_multi_lora_endpoint (
name = "My Endpoint New" ,
lora_checkpoints = checkpoints_list ,
compute = "A100-40GB"
)
endpoint = client . wait_for_endpoint_ready ( endpoint_id = endpoint_id )
# Use the model
openai_client = OpenAI (
api_key = "your_api_key_here" ,
base_url = f" { endpoint [ 'url' ] } /v1"
)
completion = openai_client . completions . create (
model = "meta-llama/Llama-3.2-1B-Instruct" ,
prompt = "Translate the following English text to French" ,
max_tokens = 60
)
print ( completion . choices [ 0 ]. text )この表は、微調整に利用できる大規模な言語モデル(LLMS)の概要を提供します。名前、家族、パラメーターカウント、コンテキスト長、および追加機能など、各モデルの重要な詳細がリストされています。
| モデル名 | 家族 | パラメーター(b) | コンテキストの長さ | VLLMサポート | ロラサポート |
|---|---|---|---|---|---|
| nvidia-llama-3.1-nemotron-70b-instruct-hf | llama3.1 | 70 | 131,072 | はい | はい |
| メタラマ-3.2-3B-instruct | llama3.2 | 3 | 131,072 | はい | はい |
| メタラマ-3.2-1B-Instruct | llama3.2 | 1 | 131,072 | はい | はい |
| ミストラルスモール - インストラクション-2409 | ミストラル | 7.2 | 128,000 | はい | はい |
| Ministral-8B-Instruct-2410 | ミストラル | 8 | 128,000 | はい | はい |
| MathStral-7B-V0.1 | ミストラル | 7 | 32,000 | はい | はい |
| QWEN2.5-CODER-7B-Instruct | QWEN2.5 | 7 | 32,768 | はい | はい |
| Aya-Expanse-32b | aya | 32 | 128,000 | はい | いいえ |
| Aya-Expanse-8b | aya | 8 | 8,000 | はい | いいえ |
| nemotron-mini-4b-instruct | Nemotron | 4 | 4,096 | はい | いいえ |
| Gemma-2-2b-it | gemma2 | 2 | 8,192 | はい | はい |
| メタラマ-3.1-70b-instruct | llama3.1 | 70 | 131,072 | はい | はい |
| メタラマ-3.1-70b-instruct | llama3.1 | 70 | 131,072 | はい | はい |
| メタラマ-3.1-70b | llama3.1 | 70 | 131,072 | はい | はい |
| メタラマ-3.1-8b-instruct | llama3.1 | 8 | 131,072 | はい | はい |
| メタラマ-3.1-8b | llama3.1 | 8 | 131,072 | はい | はい |
| メタラマ-3-70b-instruct | llama3 | 70 | 8,192 | はい | はい |
| メタラマ-3-70b | llama3 | 70 | 8,192 | はい | はい |
| メタラマ-3-8B-Instruct | llama3 | 8 | 8,192 | はい | はい |
| メタラマ-3-8b | llama3 | 8 | 8,192 | はい | はい |
| mixtral-8x7b-instruct-v0.1 | Mixtral | 46.7 | 32,768 | はい | はい |
| Mistral-7B-Instruct-V0.3 | ミストラル | 7.2 | 32,768 | はい | はい |
| ミストラルネモ - インストラクション-2407 | ミストラル | 12.2 | 128,000 | いいえ | いいえ |
| Mistral-Nemo-Base-2407 | ミストラル | 12.2 | 128,000 | いいえ | いいえ |
| gemma-2-27b-it | gemma2 | 27 | 8,192 | はい | はい |
| Gemma-2-27b | gemma2 | 27 | 8,192 | はい | はい |
| gemma-2-9b-it | gemma2 | 9 | 8,192 | はい | はい |
| Gemma-2-9b | gemma2 | 9 | 8,192 | はい | はい |
| PHI-3-MED-128K-Instruct | PHI3 | 14 | 128,000 | はい | いいえ |
| PHI-3-MED-4K-Instruct | PHI3 | 14 | 4,000 | はい | いいえ |
| PHI-3-SMALL-128K-INSTRUCT | PHI3 | 7.4 | 128,000 | はい | いいえ |
| phi-3-small-8k-instruct | PHI3 | 7.4 | 8,000 | はい | いいえ |
| PHI-3-MINI-128K-Instruct | PHI3 | 3.8 | 128,000 | はい | いいえ |
| PHI-3-MINI-4K-Instruct | PHI3 | 3.8 | 4,096 | はい | いいえ |
| QWEN2-72B-Instruct | QWEN2 | 72 | 32,768 | はい | はい |
| QWEN2-72B | QWEN2 | 72 | 32,768 | はい | はい |
| QWEN2-57B-A14B-Instruct | QWEN2 | 57 | 32,768 | はい | はい |
| QWEN2-57B-A14B | QWEN2 | 57 | 32,768 | はい | はい |
| QWEN2-7B-Instruct | QWEN2 | 7 | 32,768 | はい | はい |
| QWEN2-7B | QWEN2 | 7 | 32,768 | はい | はい |
| QWEN2-1.5B-Instruct | QWEN2 | 1.5 | 32,768 | はい | はい |
| QWEN2-1.5B | QWEN2 | 1.5 | 32,768 | はい | はい |
| QWEN2-0.5B-Instruct | QWEN2 | 0.5 | 32,768 | はい | はい |
| QWEN2-0.5B | QWEN2 | 0.5 | 32,768 | はい | はい |
| Tinyllama_v1.1 | Tinyllama | 1.1 | 2,048 | いいえ | いいえ |
| deepseek-coder-v2-lite-base | deepseek-coder-v2 | 16 | 163,840 | いいえ | いいえ |
| internlm2_5-7b-chat | internlm2.5 | 7.74 | 1,000,000 | はい | いいえ |
| internlm2_5-7b | internlm2.5 | 7.74 | 1,000,000 | はい | いいえ |
| Jamba-V0.1 | ジャンバ | 51.6 | 256,000 | はい | はい |
| yi-1.5-34b-chat | Yi-1.5 | 34.4 | 4,000 | はい | はい |
| YI-1.5-34B | Yi-1.5 | 34.4 | 4,000 | はい | はい |
| YI-1.5-34B-32K | Yi-1.5 | 34.4 | 32,000 | はい | はい |
| YI-1.5-34B-chat-16K | Yi-1.5 | 34.4 | 16,000 | はい | はい |
| yi-1.5-9b-chat | Yi-1.5 | 8.83 | 4,000 | はい | はい |
| YI-1.5-9B | Yi-1.5 | 8.83 | 4,000 | はい | はい |
| YI-1.5-9B-32K | Yi-1.5 | 8.83 | 32,000 | はい | はい |
| YI-1.5-9B-chat-16K | Yi-1.5 | 8.83 | 16,000 | はい | はい |
| yi-1.5-6b-chat | Yi-1.5 | 6 | 4,000 | はい | はい |
| YI-1.5-6B | Yi-1.5 | 6 | 4,000 | はい | はい |
| C4AI-Command-R-V01 | command-r | 35 | 131,072 | はい | いいえ |
この表は、利用可能なモデル、サイズ、機能、さまざまな微調整技術のサポートの包括的な概要を提供します。微調整のモデルを選択するときは、VLLMやLORAなどの特定の最適化手法のモデルサイズ、コンテキストの長さ、サポートなどの要因を考慮してください。