@@ -147,33 +147,33 @@ async def execute(self, user: User, request: CreateFineTuneRequest) -> CreateFin
147
147
fine_tuned_model = ensure_model_name_is_valid_k8s_label (fine_tuned_model )
148
148
149
149
if request .training_file .startswith ("file-" ):
150
- training_file = await self .file_storage_gateway .get_url_from_id (
150
+ training_file_url = await self .file_storage_gateway .get_url_from_id (
151
151
user .team_id , request .training_file
152
152
)
153
- if training_file is None :
153
+ if training_file_url is None :
154
154
raise ObjectNotFoundException ("Training file does not exist" )
155
155
else :
156
- training_file = request .training_file
156
+ training_file_url = request .training_file
157
157
158
158
if request .validation_file is not None and request .validation_file .startswith ("file-" ):
159
- validation_file = await self .file_storage_gateway .get_url_from_id (
159
+ validation_file_url = await self .file_storage_gateway .get_url_from_id (
160
160
user .team_id , request .validation_file
161
161
)
162
- if validation_file is None :
162
+ if validation_file_url is None :
163
163
raise ObjectNotFoundException ("Validation file does not exist" )
164
164
else :
165
- validation_file = request .validation_file
165
+ validation_file_url = request .validation_file
166
166
167
- check_file_is_valid (training_file , "training" )
168
- check_file_is_valid (validation_file , "validation" )
167
+ check_file_is_valid (training_file_url , "training" )
168
+ check_file_is_valid (validation_file_url , "validation" )
169
169
170
170
await self .llm_fine_tune_events_repository .initialize_events (user .team_id , fine_tuned_model )
171
171
fine_tune_id = await self .llm_fine_tuning_service .create_fine_tune (
172
172
created_by = user .user_id ,
173
173
owner = user .team_id ,
174
174
model = request .model ,
175
- training_file = training_file ,
176
- validation_file = validation_file ,
175
+ training_file = request . training_file , # for Files API, pass file ID rather than signed URL since the latter expires; fine-tuning script will get file content from Files API
176
+ validation_file = request . validation_file ,
177
177
fine_tuning_method = DEFAULT_FINE_TUNING_METHOD ,
178
178
hyperparameters = request .hyperparameters ,
179
179
fine_tuned_model = fine_tuned_model ,
0 commit comments