curl --request POST \ --url 'https://api.e2enetworks.com/myaccount/api/v1/gpu/finetuning/?project_id=<PROJECT_ID>&location=<LOCATION>&apikey=<API_KEY>' \ --header 'Authorization: Bearer <API_TOKEN>' \ --header 'Content-Type: application/json' \ --data '{ "name": "string", "training_type": "string", "training_inputs": { "source_repository_type": "string", "dataset": "string", "dataset_type": "string", "validation_split_ratio": 0, "target_dataset_field": "string", "gradient_accumulation_steps": 0, "context_length": 0, "learning_rate": 0, "epochs": 0, "stop_training_when": "string", "max_steps": 0, "batch_size": 0, "peft_lora_alpha": 0, "peft_lora_r": 0, "max_grad_norm": 0, "save_strategy": "string", "save_steps": 0, "save_total_limit": 0, "lora_dropout": 0, "lora_bias": "string", "load_in_4bit": false, "image_column": "string", "caption_column": "string", "validation_prompt": "string", "num_validation_images": 0, "train_batch_size": 0, "load_in_8bit": false, "mixed_precision": "string", "checkpointing_steps": 0, "checkpoints_total_limit": 0, "task": "string", "prompt_configuration": "string" }, "isClone": false, "model_name": "string", "sku_item_price_id": 0, "sku_item_plan": "string", "sku_item_price": "string", "huggingface_integration_id": 0}'import requests
response = requests.post( "https://api.e2enetworks.com/myaccount/api/v1/gpu/finetuning/", params={"project_id": "<PROJECT_ID>", "location": "<LOCATION>", "apikey": "<API_KEY>"}, headers={"Authorization": "Bearer <API_TOKEN>"}, json={ "name": "string", "training_type": "string", "training_inputs": { "source_repository_type": "string", "dataset": "string", "dataset_type": "string", "validation_split_ratio": 0, "target_dataset_field": "string", "gradient_accumulation_steps": 0, "context_length": 0, "learning_rate": 0, "epochs": 0, "stop_training_when": "string", "max_steps": 0, "batch_size": 0, "peft_lora_alpha": 0, "peft_lora_r": 0, "max_grad_norm": 0, "save_strategy": "string", "save_steps": 0, "save_total_limit": 0, "lora_dropout": 0, "lora_bias": "string", "load_in_4bit": False, "image_column": "string", "caption_column": "string", "validation_prompt": "string", "num_validation_images": 0, "train_batch_size": 0, "load_in_8bit": False, "mixed_precision": "string", "checkpointing_steps": 0, "checkpoints_total_limit": 0, "task": "string", "prompt_configuration": "string", }, "isClone": False, "model_name": "string", "sku_item_price_id": 0, "sku_item_plan": "string", "sku_item_price": "string", "huggingface_integration_id": 0, },)print(response.json())const url = new URL("https://api.e2enetworks.com/myaccount/api/v1/gpu/finetuning/");url.search = new URLSearchParams({ project_id: "<PROJECT_ID>", location: "<LOCATION>", apikey: "<API_KEY>" });
const response = await fetch(url, { method: "POST", headers: { "Authorization": "Bearer <API_TOKEN>", "Content-Type": "application/json" }, body: JSON.stringify({ "name": "string", "training_type": "string", "training_inputs": { "source_repository_type": "string", "dataset": "string", "dataset_type": "string", "validation_split_ratio": 0, "target_dataset_field": "string", "gradient_accumulation_steps": 0, "context_length": 0, "learning_rate": 0, "epochs": 0, "stop_training_when": "string", "max_steps": 0, "batch_size": 0, "peft_lora_alpha": 0, "peft_lora_r": 0, "max_grad_norm": 0, "save_strategy": "string", "save_steps": 0, "save_total_limit": 0, "lora_dropout": 0, "lora_bias": "string", "load_in_4bit": false, "image_column": "string", "caption_column": "string", "validation_prompt": "string", "num_validation_images": 0, "train_batch_size": 0, "load_in_8bit": false, "mixed_precision": "string", "checkpointing_steps": 0, "checkpoints_total_limit": 0, "task": "string", "prompt_configuration": "string" }, "isClone": false, "model_name": "string", "sku_item_price_id": 0, "sku_item_plan": "string", "sku_item_price": "string", "huggingface_integration_id": 0 }),});console.log(await response.json());Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Project ID
Active IAM ID (To access contact person account) Find your Active IAM ID here
Location
Request Bodyrequired
Section titled “Request Bodyrequired”object
The name of the training job
The type of training
Configuration for training inputs
object
Example generated
{ "name": "example", "training_type": "example", "training_inputs": { "source_repository_type": "example", "dataset": "example", "dataset_type": "example", "validation_split_ratio": 1, "target_dataset_field": "example", "gradient_accumulation_steps": 1, "context_length": 1, "learning_rate": 1, "epochs": 1, "stop_training_when": "example", "max_steps": 1, "batch_size": 1, "peft_lora_alpha": 1, "peft_lora_r": 1, "max_grad_norm": 1, "save_strategy": "example", "save_steps": 1, "save_total_limit": 1, "lora_dropout": 1, "lora_bias": "example", "load_in_4bit": true, "image_column": "example", "caption_column": "example", "validation_prompt": "example", "num_validation_images": 1, "train_batch_size": 1, "load_in_8bit": true, "mixed_precision": "example", "checkpointing_steps": 1, "checkpoints_total_limit": 1, "task": "example", "prompt_configuration": "example" }, "isClone": true, "model_name": "example", "sku_item_price_id": 1, "sku_item_plan": "example", "sku_item_price": "example", "huggingface_integration_id": 1}Responses
Section titled “Responses”Successful response with training job details.
object
HTTP status code for the operation.
Details of the training job.
object
Unique identifier of the training job.
Name of the training job.
Name of the model used for training.
Configuration of the training job.
object
Dataset identifier.
Name of the dataset.
Information about the source model repository.
Type of the source repository.
Path to the source model.
Task type for training.
Dataset type.
Training batch size.
Number of gradient accumulation steps.
Number of training epochs.
Maximum training steps.
Number of steps between checkpoints.
Total limit of checkpoints.
LoRA hyperparameter ‘r’.
LoRA hyperparameter ‘alpha’.
Indicates if 8-bit loading is enabled.
Type of mixed precision used.
Prompt used for validation.
Number of validation images.
Number of steps between logging.
Learning rate for training.
Limit on the number of training records.
Column used for captions.
Column used for images.
Strategy for saving checkpoints.
Condition to stop training.
Description of the training job.
Current status of the training job.
Details of the user who created the job.
object
Timestamp of job creation.
Name of the Hugging Face integration.
Pricing details of the training job.
object
SKU information for the compute resource.
object
Contains any errors that occurred.
object
Result message confirming the operation.
Example
{ "code": 200, "data": { "id": 810, "name": "tir-finetuning-111511093030", "model_name": "stabilityai/stable-diffusion-2-1", "training_inputs": { "dataset": "lambdalabs/naruto-blip-captions", "dataset_name": "lambdalabs/naruto-blip-captions", "source_model_repo_info": "", "source_repository_type": "base_model", "source_model_path": "", "task": "Instruction-Finetuning", "dataset_type": "huggingface", "train_batch_size": 1, "gradient_accumulation_steps": 1, "epochs": 3, "max_steps": -1, "checkpointing_steps": 500, "checkpoints_total_limit": 10, "peft_lora_r": 64, "peft_lora_alpha": 16, "load_in_8bit": false, "mixed_precision": "no", "validation_prompt": "A photo of a man with green eyes", "num_validation_images": 2, "logging_steps": 5, "learning_rate": 0.0000141, "limit_training_records_count": -1, "caption_column": "text", "image_column": "image", "save_strategy": "steps", "stop_training_when": "epoch_count" }, "description": null, "status": "Creating", "created_by": { "id": 3573, "name": "Nipun", "email": "nipun.arora@e2enetworks.com", "username": "nipun.arora@e2enetworks.com" }, "created_at": "2024-11-15T06:10:06.278937Z", "hugging_face_integration_name": "tir", "sku_item_price": { "sku_item_price_id": 763, "sku_type": "hourly", "committed_days": 0, "unit_price": 470.4, "currency": "INR", "description": "Hourly Compute Instance: pipeline" }, "sku": { "sku_id": 166, "name": "GDC.1xH200-30.375GB_SXM", "series": "GPU", "cpu": 30, "gpu": 1, "memory": 375, "is_free": false } }, "errors": {}, "message": "Success"}