Skip to content

Commit

Permalink
DH-5033/add alias
Browse files Browse the repository at this point in the history
  • Loading branch information
MohammadrezaPourreza committed Dec 13, 2023
1 parent def6fba commit 7a307f2
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions dataherald/api/fastapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,7 @@ def create_finetuning_job(
model = model_repository.insert(
Finetuning(
db_connection_id=fine_tuning_request.db_connection_id,
alias=fine_tuning_request.alias,
base_llm=fine_tuning_request.base_llm,
golden_records=[
str(golden_record.id) for golden_record in golden_records
Expand Down
2 changes: 2 additions & 0 deletions dataherald/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ class BaseLLM(BaseModel):

class Finetuning(BaseModel):
id: str | None = None
alias: str | None = None
db_connection_id: str | None = None
status: str = "queued"
error: str | None = None
Expand All @@ -172,6 +173,7 @@ class Finetuning(BaseModel):

class FineTuningRequest(BaseModel):
db_connection_id: str
alias: str
base_llm: BaseLLM
golden_records: list[str] | None = None
metadata: dict[str, str] | None = None
Expand Down
2 changes: 2 additions & 0 deletions docs/api.cancel_finetuning.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ HTTP 200 code response
{
"id": "finetuing-job-id",
"db_connection_id": "database_connection_id"
"alias": "model name"
"status": "finetuning_job_status" # queued is default other possible values are [queued, running, succeeded, failed, validating_files, or cancelled]
"error": "The error message if the job failed" # optional default value is None
"base_llm": {
Expand Down Expand Up @@ -63,6 +64,7 @@ HTTP 200 code response
{
"id": "finetuning-job-id",
"alias": "my_model",
"db_connection_id": "database_connection_id",
"status": "cancelled",
"error": "Fine tuning cancelled by the user",
Expand Down
6 changes: 5 additions & 1 deletion docs/api.finetuning.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Request this ``POST`` endpoint to create a finetuning job::
{
"db_connection_id": "database_connection_id"
"alias": "model name",
"base_llm": {
"model_provider": "model_provider_name" # right now openai is the only provider.
"model_name": "model_name" # right now gpt-3.5-turbo and gpt-4 are suported.
Expand All @@ -37,7 +38,8 @@ HTTP 201 code response
{
"id": "finetuing-job-id",
"db_connection_id": "database_connection_id"
"db_connection_id": "database_connection_id",
"alias": "model name",
"status": "finetuning_job_status" # queued is default other possible values are [queued, running, succeeded, failed, validating_files, or cancelled]
"error": "The error message if the job failed" # optional default value is None
"base_llm": {
Expand Down Expand Up @@ -67,6 +69,7 @@ HTTP 201 code response
-H 'Content-Type: application/json' \
-d '{
"db_connection_id": "database_connection_id",
"alias": "my_model",
"base_llm": {
"model_provider": "openai",
"model_name": "gpt-3.5-turbo-1106",
Expand All @@ -83,6 +86,7 @@ HTTP 201 code response
{
"id": "finetuning-job-id",
"alias": "my_model",
"db_connection_id": "database_connection_id",
"status": "queued",
"error": null,
Expand Down
2 changes: 2 additions & 0 deletions docs/api.get_finetuning.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ HTTP 200 code response
{
"id": "finetuing-job-id",
"db_connection_id": "database_connection_id"
"alias": "model name"
"status": "finetuning_job_status" # queued is default other possible values are [queued, running, succeeded, failed, validating_files, or cancelled]
"error": "The error message if the job failed" # optional default value is None
"base_llm": {
Expand Down Expand Up @@ -50,6 +51,7 @@ HTTP 200 code response
{
"id": "finetuning-job-id",
"db_connection_id": "database_connection_id",
"alias": "my_model",
"status": "validating_files",
"error": null,
"base_llm": {
Expand Down
1 change: 1 addition & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ Related endpoints are:
{
"id": "finetuing-job-id",
"db_connection_id": "database_connection_id",
"alias": "model name",
"status": "finetuning_job_status", // Possible values: queued, running, succeeded, validating_files, failed, or cancelled
"error": "The error message if the job failed", // Optional, default is None
"base_llm": {
Expand Down

0 comments on commit 7a307f2

Please sign in to comment.