-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fine-tuning updates, add gpt-4-turbo and other spec updates
- Loading branch information
1 parent
8dabf8a
commit bbd3aa4
Showing
11 changed files
with
139 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
src/main/java/io/github/stefanbratanov/jvm/openai/FineTuningJobIntegration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
package io.github.stefanbratanov.jvm.openai; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
public record FineTuningJobIntegration(String type, Wandb wandb) { | ||
|
||
public record Wandb( | ||
String project, Optional<String> name, Optional<String> entity, Optional<List<String>> tags) { | ||
|
||
public static Builder newBuilder() { | ||
return new Builder(); | ||
} | ||
|
||
public static class Builder { | ||
|
||
private String project; | ||
private Optional<String> name = Optional.empty(); | ||
private Optional<String> entity = Optional.empty(); | ||
private Optional<List<String>> tags = Optional.empty(); | ||
|
||
/** | ||
* @param project The name of the project that the new run will be created under. | ||
*/ | ||
public Builder project(String project) { | ||
this.project = project; | ||
return this; | ||
} | ||
|
||
/** | ||
* @param name A display name to set for the run. If not set, we will use the Job ID as the | ||
* name. | ||
*/ | ||
public Builder name(String name) { | ||
this.name = Optional.of(name); | ||
return this; | ||
} | ||
|
||
/** | ||
* @param entity The entity to use for the run. This allows you to set the team or username of | ||
* the WandB user that you would like associated with the run. If not set, the default | ||
* entity for the registered WandB API key is used. | ||
*/ | ||
public Builder entity(String entity) { | ||
this.entity = Optional.of(entity); | ||
return this; | ||
} | ||
|
||
/** | ||
* @param tags A list of tags to be attached to the newly created run. These tags are passed | ||
* through directly to WandB. Some default tags are generated by OpenAI: | ||
* "openai/finetune", "openai/{base-model}", "openai/{ftjob-abcdef}". | ||
*/ | ||
public Builder tags(List<String> tags) { | ||
this.tags = Optional.of(tags); | ||
return this; | ||
} | ||
|
||
public Wandb build() { | ||
return new Wandb(project, name, entity, tags); | ||
} | ||
} | ||
} | ||
|
||
static FineTuningJobIntegration wandbIntegration(Wandb wandb) { | ||
return new FineTuningJobIntegration(Constants.WANDB_INTEGRATION_TYPE, wandb); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.