Live data from Hacker News

Show HN: GPT Repo Loader – load entire code repos into GPT prompts

github.com

101–110 of 162 posts

Re: Show HN: GPT Repo Loader – load entire code repos into GPT prompts

#101
post #10

This is awesome, can't wait to get api access to the 32k token model. Rather than this approach of just converting the whole repo to a text file, what I'm thinking is, you can let the model decide the most relevant files. The initial prompt would be, "person wants to do x, here are the file list of this repo: ...., give me a list of files that you'd want to edit, create or delete" -> take the list, try to fit the con…

Maybe someone can correct me, but my understanding is that you would calculate the embeddings of code chunks, and the embedding of the prompt, and take those chunks that are most similar to the embedding of the prompt as context.

Edit: This, btw, is also the reason why I think that this here popped up on the hackernews frontpage a short while ago: https://github.com/pgvector/pgvector

Re: Show HN: GPT Repo Loader – load entire code repos into GPT prompts

#102
post #74
post #16

Earlier quoted context omitted.

> GPT-4 knows how to decode it I wonder if you could teach it to understand a binary encoding using the raw bytestream, feed it compressed text, and just tell it to decompress it first.

Here is what GPT-4 says about it. "As an AI language model, I can understand and work with various text encoding schemes and compression algorithms. However, to work with a raw bytestream, you would need to provide specific details about the encoding and compression used. To teach me to understand a particular binary encoding and compressed text format, you should provide the following information: The binary encodin…

When GPT gives an answer like that, is it actually a meaningful description of its capabilities? Does it have that kind of self-awareness? Or is it just a plausible answer based on the training corpus?

Genuine question.

Re: Show HN: GPT Repo Loader – load entire code repos into GPT prompts

#104

isn't this a massive privacy violation? any employer would most likely not be okay with this.

it’s a proof of concept. you will have on-premise models soon that are privacy preserving, and OpenAI can set up another tier of API that has privacy-preserving TOS (just like cloud providers do)

Re: Show HN: GPT Repo Loader – load entire code repos into GPT prompts

#105
post #49
post #33

Earlier quoted context omitted.

This is not true anymore, they changed their terms so this is now opt in.

It's still probably extemely against any reasonable business's code of conduct.

Why would it be? Most businesses have no issue hosting private stuff on cloud or in github private repos.

TOS and trust matter the most.

Re: Show HN: GPT Repo Loader – load entire code repos into GPT prompts

#106

Earlier quoted context omitted.

I'm already at the point where I get frustrated when GPT writes some incorrect code - despite it saving me enormous amounts of time. The appetite for productivity seems to be insatiable. I want to be able to create a million lines of code per month by myself.

So relatable! I find myself getting irritated when it gets stuck on something and I have to intervene, yet it helps absolutely shred LOCs in some other cases.

"If we wish to count lines of code, we should not regard them as lines produced but as lines spent." — Dijkstra

Re: Show HN: GPT Repo Loader – load entire code repos into GPT prompts

#107
Am I missing something? From what I understood from Wolfram description of GPT and GPT in 60 lines of Python, a GPT model's only memory is the input buffer. So 4k token for GPT3, some more but still limited for GPT4.

To summarize the GPT inference process as I understood it, with GPT3 as example:

1) the input buffer is made of 4k token. There are about 50k token. So the input is a vector of token ids. We can see it as a point in a high dimensional space;

2) The core neural network is a pure function: for such an input point, it will return an output vector as large as there are token. So here, a 50k element vector, where each entry is the probability that the associated token is the next element.

The very important thing here is that the whole neural network is a pure function: same input, same output. With immensely large super fast memory this function could be implemented as a look-up table, from an input point (buffer) to an output probability vector. No memory, no side effect here.

3) The probability vector is fed into a "next token" function. It doesn't just take the highest probability token (boring result), but use a "temperature" to randomize a bit, while using the output probabilities;

4) The next token chosen is inserted into the input buffer, keeping the same total number of token. Go back to (1) until a "stop" token is selected at (3).

So in effect, the whole process is a function from a point to a point. "point" here is the buffer seen as a (high dimensional) vector, so a point in a high dimension space. The generation process is in effect a walk in this "buffer space". Prompting puts the model into some part of the state, with some semantic relation to the prompt semantic content (that's the magic part). Then generation is a walk in this space, with a purely deterministic part (2) and a bit of randomization (3) to make the walk trajectory (and its meaning, which is what we care about) more interesting to us.

So if this is correct, there is no point in injecting a lot of data into a GPT model: the output is defined by the input buffer size. Just input the last 4k token (for GPT3, more for GPT4) and you're done: everything else would have disappeared. So here, just input the last 4k token of a repo and save some money ;)

To avoid this limitation, one would have to summarize the previous input, and make this summary part of the current input buffer. This is what chaining is all about if I understood correctly. But I don't see chaining here.

Sooo... Am I missing something? Or is the author of this script the one missing something? I don't mind it either way, but I'd appreciate some clarification from knowledgeable people ;)

Thanks

Re: Show HN: GPT Repo Loader – load entire code repos into GPT prompts

#108
Seeing a lot of comments in here about the token limits.

Another path you can take is to fine tune a model on your business. Each training item has to fit within the token limit, but you can send hundreds of megs of these for training.

It's more expensive to run a FT model, but you don't have to include any prior context (assuming it's common to all prompts).

Re: Show HN: GPT Repo Loader – load entire code repos into GPT prompts

#110
post #52
post #2

From what I understand this seems useful if you have a model that will accept a large or unlimited number of tokens. I was looking into doing the same thing with ChatGPT and went with ada to find snippets related to the prompt and then to include those with a prompt to ChatGPT: https://bbarrows.com/posts/using-embeddings-ada-and-chatgpt-... Does ChatGPT 4 now accept more tokens maybe?

ChatGPT 4 currently accepts 8000 tokens and will eventually support 32k

I can't get it to eat 8k tokens. I assume this is only available via the api. The web interface is limited to around 2k tokens.
Post reply on HN