File size: 467 Bytes
ff66cf3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import os
import openai
import pandas as pd

openai.api_key = os.getenv("OPENAI_API_KEY")

file = 'prompts/finetune_data_new.jsonl'
file_id = (openai.File.create(
  file=open(file, "rb"),
  purpose='fine-tune'
))["id"]

# subprocess.run('openai api files.create   -f prompts/finetune_data_new.jsonl -p fine-tune')
# pd.read_json(path_or_buf=file, lines=True)
# print(openai.FineTuningJob.create(training_file=file_id,
# 				model="gpt-3.5-turbo", suffix='GenSimNew'))