openai-java icon indicating copy to clipboard operation
openai-java copied to clipboard

Parsing error, when trying to create fine tuning job

Open pavelber opened this issue 1 year ago • 0 comments

Hi! I uploaded a test file with fine tune model

{"messages": [{"role": "system", "content": "Marv is a factual chatbot that is also sarcastic."}, {"role": "user", "content": "What's the capital of France?"}, {"role": "assistant", "content": "Paris, as if everyone doesn't know that already."}]}
{"messages": [{"role": "system", "content": "Marv is a factual chatbot that is also sarcastic."}, {"role": "user", "content": "Who wrote 'Romeo and Juliet'?"}, {"role": "assistant", "content": "Oh, just some guy named William Shakespeare. Ever heard of him?"}]}
{"messages": [{"role": "system", "content": "Marv is a factual chatbot that is also sarcastic."}, {"role": "user", "content": "How far is the Moon from Earth?"}, {"role": "assistant", "content": "Around 384,400 kilometers. Give or take a few, like that really matters."}]}

Using this code:

private fun uploadFile(service: OpenAiService, fname:String) {
    val file = service.uploadFile("fine-tune", "src/main/resources/$fname")
    println(file)
}```

Then I'm trying to create a fine tuning job using this code:

private fun createFineTuneJob(service: OpenAiService, fid:String) { val job = service.createFineTuningJob( FineTuningJobRequest.builder().model("gpt-3.5-turbo").trainingFile(fid) .suffix("pavel-test").build() ) println(job) }


and I get exception:
 Exception in thread "main" java.lang.RuntimeException: com.fasterxml.jackson.databind.exc.InvalidFormatException: 
 Cannot deserialize value of type `java.lang.Integer` from String "auto": not a valid `java.lang.Integer` value
  at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 14, column: 17] (through 
  reference chain: com.theokanning.openai.fine_tuning.FineTuningJob["hyperparameters"] 
  - >com.theokanning.openai.fine_tuning.Hyperparameters["n_epochs"])
at io.reactivex.internal.util.ExceptionHelper.wrapOrThrow(ExceptionHelper.java:45)
at io.reactivex.internal.observers.BlockingMultiObserver.blockingGet(BlockingMultiObserver.java:90)
at io.reactivex.Single.blockingGet(Single.java:2002)
at com.theokanning.openai.service.OpenAiService.execute(OpenAiService.java:513)
at com.theokanning.openai.service.OpenAiService.createFineTuningJob(OpenAiService.java:191)
at com.anymaint.labeling.openai.OpenAIPlaygroundKt.createFineTuneJob(OpenAIPlayground.kt:30)
at com.anymaint.labeling.openai.OpenAIPlaygroundKt.main(OpenAIPlayground.kt:25)
at com.anymaint.labeling.openai.OpenAIPlaygroundKt.main(OpenAIPlayground.kt)

What's wrong?

Thank you

pavelber avatar Mar 26 '24 09:03 pavelber