|
@@ -241,6 +241,7 @@ def gpt():
|
|
|
|
|
|
@app.route('/train', methods=['POST'])
|
|
|
def train():
|
|
|
+ prev_model = "gpt-3.5-turbo"
|
|
|
if 'job_id' in request.form:
|
|
|
return train_with_id(job_id=request.form['job_id'])
|
|
|
elif 'train_file' in request.files:
|
|
@@ -252,6 +253,8 @@ def train():
|
|
|
openai_file = csv_to_jsonl(train_file.stream.read())
|
|
|
elif train_file.filename.split('.')[1] == 'json':
|
|
|
openai_file = alpaca_to_chatgpt(train_file)
|
|
|
+ if 'prev_model' in request.form:
|
|
|
+ prev_model = request.form['prev_model']
|
|
|
if 'mock' not in request.form:
|
|
|
f = app.openai_client.files.create(
|
|
|
file=openai_file,
|
|
@@ -259,7 +262,7 @@ def train():
|
|
|
)
|
|
|
job = app.openai_client.fine_tuning.jobs.create(
|
|
|
training_file=f.id,
|
|
|
- model="gpt-3.5-turbo",
|
|
|
+ model=prev_model,
|
|
|
hyperparameters={
|
|
|
"n_epochs": 5
|
|
|
}
|