I’ve made a fine-tuning model which works perfectly in the playground, but when i use my own script it comes out with a way worse result, I’ve no idea why it does it.
Playground example:
User:
Arne Jacobsen Seven chair in black leather, Fritz Hansen, black leather chrome frame prdouced in 2010 good condition few marks and scratches on the leather and a lite patina chrome frame black leather,“Height 30 / Width 20 / Depth 40 / Seat height 44,5 Cm”
Assistant:
Arne Jacobsen Seven chair upholstered in black leather divided with a chrome frame. The chair is from 2010 and is generally in good condition, but with few marks and small scratches on the leather, and a light patina chrome frame.
*Designer: Arne Jacobsen
*Manufacturer: Fritz Hansen
*Model: Seven Chair
*Dimensions: Height: 30 / Width: 20 / Depth: 40 / Seat height: 44,5 Cm
*Materials: Black leather and chrome frame
*Condition: Pre-owned chair from 2010
This is the perfect output, but when i use my own script as shown below:
import csv
import openai
import pandas as pd
from dotenv import load_dotenv
import os
load_dotenv()
API_KEY = os.getenv("API")
openai.api_key = API_KEY
model_name = "ft:gpt-3.5-turbo-0613:personal::123123"
input_csv_path = "C:/Users/myname/OneDrive/code/auto-v/csv.csv"
#read the csv file into a dataframe
df = pd.read_csv(input_csv_path, header=None)
for index, row in df.iterrows():
name = row[0]
producer = row[4]
description = row[5]
measurements = row[6]
print(name, producer, description, measurements)
#generate text
response = openai.Completion.create(
engine = "text-davinci-002",
prompt=f"write a product description on the following on this product: {name} {producer} {description} {measurements}",
max_tokens=1000
)
print(response)
#extract the generated text
generated_text = response.choices[0].text.strip()
#append the generated text to the last coulmn
row[9] = generated_text
#save the dataframe back to the csv file
df.to_csv(input_csv_path, header=False, index=False)
it returns this:
*An ultra-modern classic, the Arne Jacobsen Seven chair is a beautifully designed *
piece that will add a touch of elegance to any home. The sleek black leather and chrome frame are perfect for a contemporary space, and the chair is in good condition with only a few marks and scratches on the leather and chrome. The chair is comfortable and stylish, and would make a great addition to any home.
Can anyone explain why the outputs are so massively different?
The input is the exact same, but I do extract it from a CSV file, but that shouldn’t make a difference