You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+76
Original file line number
Diff line number
Diff line change
@@ -48,6 +48,54 @@ use HalilCosdu\FineTuner\Facades\FineTuner;
48
48
// Generate examples for fine-tuning
49
49
$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.")
50
50
51
+
array:2 [▼
52
+
"training_data" => array:1 [▼
53
+
0 => array:1 [▼
54
+
"messages" => array:3 [▼
55
+
0 => array:2 [▼
56
+
"role" => "system"
57
+
"content" => "Given your current situation and needs, how can I assist you today?"
58
+
]
59
+
1 => array:2 [▼
60
+
"role" => "user"
61
+
"content" => "Hey AI, I've been feeling really stressed out lately because of work. Any advice on how I can manage this better?"
62
+
]
63
+
2 => array:2 [▼
64
+
"role" => "assistant"
65
+
"content" => """
66
+
I'm really sorry to hear that you're feeling this way, but please know that it's okay to feel stressed. Here are a few suggestions that might help:
67
+
68
+
69
+
70
+
1. Mindfulness and Relaxation: Try techniques like deep breathing, meditation, or yoga. They can help you to stay calm and focused.
71
+
72
+
73
+
74
+
2. Time Management: Prioritize your tasks and break them down into manageable chunks. Remember, it's okay to say no to tasks that are not a priority.
75
+
76
+
77
+
78
+
3. Physical Activity: Regular exercise can help reduce stress levels. Even a short walk can make a difference.
79
+
80
+
81
+
82
+
4. Connect with Others: Talk to someone you trust about your stress. It can often help to share what you're experiencing.
83
+
84
+
85
+
86
+
5. Professional Help: If your stress continues or leads to feelings of despair, it might be helpful to speak with a mental health professional.
87
+
88
+
89
+
90
+
Remember, everyone experiences stress differently and different techniques work for different people. It's important to find what works best for you.
91
+
"""
92
+
]
93
+
]
94
+
]
95
+
]
96
+
"file_url" => null
97
+
]
98
+
51
99
// 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`.
The `php artisan laravel-finetuner` command is used to interact with the Laravel Finetuner package. This command initiates a process that generates examples.
109
+
110
+
Here's a detailed explanation of how to use this command:
111
+
112
+
1. Open your terminal.
113
+
114
+
2. Navigate to your Laravel project directory.
115
+
116
+
3. Run the command `php artisan laravel-finetuner`.
117
+
118
+
4. The command will first ask for a `Prompt`. This is a string that will be used to generate examples for fine-tuning. If you don't provide a prompt, it will use a default one.
119
+
120
+
5. Next, it will ask for the `Temperature`. This is a float value that controls the randomness of the examples generated. A higher value will result in more random examples. If you don't provide a temperature, it will use a default value of `.4`.
121
+
122
+
6. Then, it will ask for the `Number of examples`. This is an integer that specifies how many examples to generate. If you don't provide a number, it will use a default value of `1`.
123
+
124
+
7. After you've provided these inputs, the command will ask for your confirmation to continue. If you confirm, it will start generating examples, which may take a while.
125
+
126
+
8. Once the examples are generated, they will be uploaded. If there's an error during this process, the command will display an error message.
127
+
128
+
9. If everything goes well, the command will display a URL. This URL points to the location where the generated examples were uploaded.
129
+
130
+
Remember, this command is part of the Laravel Finetuner package, which is designed to automate the fine-tuning of OpenAI models in Laravel applications.
Copy file name to clipboardExpand all lines: src/Commands/FineTunerCommand.php
+26-4
Original file line number
Diff line number
Diff line change
@@ -2,18 +2,40 @@
2
2
3
3
namespaceHalilCosdu\FineTuner\Commands;
4
4
5
+
useHalilCosdu\FineTuner\Facades\FineTuner;
5
6
useIlluminate\Console\Command;
6
7
7
8
class FineTunerCommand extends Command
8
9
{
9
10
public$signature = 'laravel-finetuner';
10
11
11
-
public$description = 'My command';
12
+
public$description = 'Command to generate examples, upload them, and start a fine-tuning job with Laravel Finetuner';
12
13
13
-
publicfunctionhandle(): int
14
+
privateconstDEFAULT_PROMPT = "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.";
0 commit comments