PHP code example of halilcosdu / laravel-finetuner
1. Go to this page and download the library: Download halilcosdu/laravel-finetuner library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use HalilCosdu\FineTuner\Facades\FineTuner;
// Generate examples for fine-tuning
$trainingExamples = FineTuner::generateExamples("A versatile AI assistant designed to provide personalized support across all aspects of life, from physical health and mental wellness to emotional well-being, adapting its guidance to the user's unique situation and needs. It offers practical advice, empathetic support, and proactive reminders, all while ensuring privacy and security, and continuously evolving through feedback and research.")
// If the `FINE_TUNER_USE_STORAGE` environment variable is set to `true`, the `file_url` will be returned for the upload function. Alternatively, you can create your own training `.jsonl` file using the `training_data`.
// Upload the training data
$fileId = FineTuner::upload($trainingExamples['file_url'])
// Fine-tune the model
FineTuner::fineTune($fileId, 'gpt-3.5-turbo')