flex_ai
0.42
Twitter (AKA 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) المتاحة للضبط الدقيق ، والتي تم طلبها تقريبًا من الأكثر شهرة إلى الأقل دراية. يسرد التفاصيل الرئيسية لكل طراز ، بما في ذلك اسمه وعائلته وعدد المعلمات وطول السياق وميزات إضافية.
| اسم النموذج | عائلة | المعلمات (ب) | طول السياق | دعم VLLM | دعم لورا |
|---|---|---|---|---|---|
| nvidia-llama-3.1-nemotron-70b-instruct-hf | llama3.1 | 70 | 131،072 | نعم | نعم |
| meta-llama-3.2-3b-instruct | Llama3.2 | 3 | 131،072 | نعم | نعم |
| meta-llama-3.2-1b-instruct | Llama3.2 | 1 | 131،072 | نعم | نعم |
| Mistral-Small-instruct-2409 | خطأ | 7.2 | 128000 | نعم | نعم |
| الوزارة -8B-instruct-2410 | خطأ | 8 | 128000 | نعم | نعم |
| Mathstral-7B-V0.1 | خطأ | 7 | 32000 | نعم | نعم |
| QWEN2.5-CODER-7B-instruct | Qwen2.5 | 7 | 32768 | نعم | نعم |
| AYA-EXPANSE-32B | آية | 32 | 128000 | نعم | لا |
| AYA-EXPANSE-8B | آية | 8 | 8000 | نعم | لا |
| Nemotron-Mini-4b-instruct | نيمووترون | 4 | 4،096 | نعم | لا |
| gemma-2-2b-it | GEMMA2 | 2 | 8،192 | نعم | نعم |
| meta-llama-3.1-70b-instruct | llama3.1 | 70 | 131،072 | نعم | نعم |
| meta-llama-3.1-70b-instruct | llama3.1 | 70 | 131،072 | نعم | نعم |
| meta-llama-3.1-70b | llama3.1 | 70 | 131،072 | نعم | نعم |
| meta-llama-3.1-8b-instruct | llama3.1 | 8 | 131،072 | نعم | نعم |
| meta-llama-3.1-8b | llama3.1 | 8 | 131،072 | نعم | نعم |
| meta-llama-3-70b-instruct | لاما 3 | 70 | 8،192 | نعم | نعم |
| meta-llama-3-70b | لاما 3 | 70 | 8،192 | نعم | نعم |
| meta-llama-3-8b-instruct | لاما 3 | 8 | 8،192 | نعم | نعم |
| Meta-llama-3-8b | لاما 3 | 8 | 8،192 | نعم | نعم |
| mixtral-8x7b-instruct-v0.1 | mixtral | 46.7 | 32768 | نعم | نعم |
| MISTRAL-7B-instruct-V0.3 | خطأ | 7.2 | 32768 | نعم | نعم |
| Mistral-nemo-instruct-2407 | خطأ | 12.2 | 128000 | لا | لا |
| Mistral-Nemo-Base-2407 | خطأ | 12.2 | 128000 | لا | لا |
| 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-Medium-128K-instruct | PHI3 | 14 | 128000 | نعم | لا |
| PHI-3-Medium-4K-instruct | PHI3 | 14 | 4000 | نعم | لا |
| PHI-3-Small-128k-instruct | PHI3 | 7.4 | 128000 | نعم | لا |
| PHI-3-Small-8K-instruct | PHI3 | 7.4 | 8000 | نعم | لا |
| PHI-3-MINI-128K-instruct | PHI3 | 3.8 | 128000 | نعم | لا |
| PHI-3-MINI-4K-instruct | PHI3 | 3.8 | 4،096 | نعم | لا |
| Qwen2-72b-instruct | Qwen2 | 72 | 32768 | نعم | نعم |
| Qwen2-72b | Qwen2 | 72 | 32768 | نعم | نعم |
| QWEN2-57B-A14B-instruct | Qwen2 | 57 | 32768 | نعم | نعم |
| QWEN2-57B-A14B | Qwen2 | 57 | 32768 | نعم | نعم |
| Qwen2-7B-instruct | Qwen2 | 7 | 32768 | نعم | نعم |
| Qwen2-7b | Qwen2 | 7 | 32768 | نعم | نعم |
| Qwen2-1.5b-instruct | Qwen2 | 1.5 | 32768 | نعم | نعم |
| Qwen2-1.5b | Qwen2 | 1.5 | 32768 | نعم | نعم |
| Qwen2-0.5b-instruct | Qwen2 | 0.5 | 32768 | نعم | نعم |
| Qwen2-0.5b | Qwen2 | 0.5 | 32768 | نعم | نعم |
| tinyllama_v1.1 | Tinyllama | 1.1 | 2048 | لا | لا |
| 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 | 256000 | نعم | نعم |
| yi-1.5-34b-Chat | يي -1.5 | 34.4 | 4000 | نعم | نعم |
| يي -1.5-34B | يي -1.5 | 34.4 | 4000 | نعم | نعم |
| yi-1.5-34b-32k | يي -1.5 | 34.4 | 32000 | نعم | نعم |
| yi-1.5-34b-chat-16k | يي -1.5 | 34.4 | 16000 | نعم | نعم |
| yi-1.5-9b-Chat | يي -1.5 | 8.83 | 4000 | نعم | نعم |
| يي -1.5-9B | يي -1.5 | 8.83 | 4000 | نعم | نعم |
| yi-1.5-9b-32k | يي -1.5 | 8.83 | 32000 | نعم | نعم |
| yi-1.5-9b-chat-16k | يي -1.5 | 8.83 | 16000 | نعم | نعم |
| yi-1.5-6b-Chat | يي -1.5 | 6 | 4000 | نعم | نعم |
| يي -1.5-6B | يي -1.5 | 6 | 4000 | نعم | نعم |
| C4ai-Command-R-V01 | Command-R | 35 | 131،072 | نعم | لا |
يوفر هذا الجدول نظرة عامة شاملة على النماذج المتاحة ، وأحجامها ، وقدراتها ، ودعم تقنيات التثبيت المختلفة. عند اختيار نموذج للضبط الدقيق ، فكر في عوامل مثل حجم النموذج وطول السياق ودعم تقنيات التحسين المحددة مثل VLLM و LORA.