Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
Add fine-tuning api models to json test (#379)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheoKanning authored Oct 22, 2023
1 parent a4f2df8 commit 44cba2e
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ public class FineTuningEvent {
*/
String object;

/**
* The ID of the fine-tuning event.
*/
String id;

/**
* The creation time in epoch seconds.
*/
Expand Down
8 changes: 6 additions & 2 deletions api/src/test/java/com/theokanning/openai/JsonTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
import com.theokanning.openai.embedding.EmbeddingResult;
import com.theokanning.openai.engine.Engine;
import com.theokanning.openai.file.File;
import com.theokanning.openai.fine_tuning.FineTuningEvent;
import com.theokanning.openai.fine_tuning.FineTuningJob;
import com.theokanning.openai.fine_tuning.FineTuningJobRequest;
import com.theokanning.openai.finetune.FineTuneEvent;
import com.theokanning.openai.finetune.FineTuneResult;
import com.theokanning.openai.image.CreateImageEditRequest;
import com.theokanning.openai.image.CreateImageRequest;
import com.theokanning.openai.image.ImageResult;
import com.theokanning.openai.model.Model;
import com.theokanning.openai.moderation.ModerationRequest;
Expand Down Expand Up @@ -43,6 +44,9 @@ public class JsonTest {
File.class,
FineTuneEvent.class,
FineTuneResult.class,
FineTuningEvent.class,
FineTuningJob.class,
FineTuningJobRequest.class,
ImageResult.class,
TranscriptionResult.class,
TranslationResult.class,
Expand Down
8 changes: 8 additions & 0 deletions api/src/test/resources/fixtures/FineTuningEvent.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"object": "fine_tuning.job.event",
"id": "ft-event-ddTJfwuMVpfLXseO0Am0Gqjm",
"created_at": 1692407401,
"level": "info",
"message": "Fine tuning job successfully completed",
"type": "message"
}
19 changes: 19 additions & 0 deletions api/src/test/resources/fixtures/FineTuningJob.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"id": "ftjob-abc123",
"object": "fine_tuning.job",
"model": "davinci-002",
"status": "succeeded",
"hyperparameters": {
"n_epochs": 4
},
"created_at": 1692661014,
"finished_at": 1692661190,
"fine_tuned_model": "ft:davinci-002:my-org:custom_suffix:7q8mpxmy",
"organization_id": "org-123",
"training_file": "file-abc123",
"result_files": [
"file-abc123"
],
"validation_file": "validation-file",
"trained_tokens": 5768
}
9 changes: 9 additions & 0 deletions api/src/test/resources/fixtures/FineTuningJobRequest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"model": "davinci-002",
"validation_file": "file-abc123",
"training_file": "file-abc123",
"hyperparameters": {
"n_epochs": 4
},
"suffix": "test"
}

0 comments on commit 44cba2e

Please sign in to comment.