minimaxir / simpleaichat

Python package for easily interfacing with chat apps, with robust features and minimal code complexity.
MIT License
3.49k stars 229 forks source link

how to solve the prompt length #89

Open ArwaKhalid opened 1 year ago

ArwaKhalid commented 1 year ago

hello, i tried to use your code for a binary classification :
|__

`%%time
system_optimized = 'in light of these binary classified examples ....  whether not paraphrased or paraphrased return 0 or 1  without explanation.'
params = {"temperature": 0.0}  
model = "gpt-3.5-turbo" 

ai_2 = AIChat(api_key=api_key, system=system_optimized, model=model, params=params)

predicted_label = []

for i in range(len(train_text)):
         prompt = 'text = ' + train_text[I]
         predicted_label.append(ai_2(prompt))`

it works and returns 0 or 1 but loops only for a few times (5) and then raises an error (the prompt length exceeds the accepted length ) while the max-length of text in my dataset is 200 words.