gpt4all icon indicating copy to clipboard operation
gpt4all copied to clipboard

Code generation is not up to mark

Open SBTopZZZ-LG opened this issue 1 year ago • 1 comments

Hi. I don't know if this is the expected behaviour of the model, but the code it generates is not up to mark.

I was testing and goofing around with it for quite some time now, and it's very decent. Later however, I decided to ask it to write some codes for me and, it seems like the model only generates codes in Python 3, regardless of the specified syntax through the prompt.

image

image

Is this an expected behaviour? Thank you.

SBTopZZZ-LG avatar Apr 15 '23 16:04 SBTopZZZ-LG

Try rerunning the programm. It might get stuck on a behaviour it showed in previous messages.

imwide avatar Apr 15 '23 18:04 imwide

Actually if you look at what the models are trained on at the botton of the website here https://gpt4all.io , you will notice python (the orange and red dots) is involved a lot, and its presence is so large it's categorized by itself, and so model thinks python is the way to go whenever programming is mentioned. It definitely is not a desirable behavior, but it's also expected from how the models are made. CleanShot 2023-05-16 at 22 32 36@2x

So, yes, it is expected, you can try forcing your language by ending your prompt with ```java to signal this java code block has to be there, and hopefully the model will start to make more sense on what you're asking for.

mio9 avatar May 16 '23 13:05 mio9

Quick update, I tested with Java using GPT4All-L13b-snoozy , seems like it's working just as well after assisting the model for a bit CleanShot 2023-05-17 at 00 11 04@2x

EDIT: Same approach works for other languages, but the model prefer using pre-implemented functions rather than actually chewing out algorithms

mio9 avatar May 16 '23 15:05 mio9

Stale, please open a new, updated issue if this is still relevant.

niansa avatar Aug 11 '23 11:08 niansa