Live data from Hacker News

Show HN: Customizable, embeddable Chat GPT based on your own documents

libraria.dev

11–20 of 135 posts

Re: Show HN: Customizable, embeddable Chat GPT based on your own documents

#11
post #7

Earlier quoted context omitted.

It's a great question! Right now, I don't train anything, I've broken the text down to n characters and created embeddings for that subset of text -- then I search for the closest distance / relationships between the question asked. Then I add the text to the prompt, and tell gpt to use those paragraphs to answer the question (to ensure that it doesn't make anything up). This is one of the ways I can get around the t…

Oh! I think I understand. So your software takes a prompt from me, does non-GPT work to find additional context from your source (the books, parsed and re-structured into word vectors or whatnot), and then asks GPT my prompt combined with the added context? Like, “What are the three foobars when considering these passages from a book ?”

Yeah more or less! I still use open ai for their embeddings (translating text into vector space)

- Your question -> vectors with open ai embeddings - Text you uploaded before -> vectors with open ai embeddings

Get the most similar above a certain threshold, and then add it to the prompt saying

"From these articles / paragraphs, answer the user's question: What are the three foobars"

So yep! I preprocess it

Re: Show HN: Customizable, embeddable Chat GPT based on your own documents

#13

so - if i download a boatload of research papers from scihub about topic X - this will be base its knowledge off them? if so i was just thinking this would be cool to have - and here it is?

I was thinking something similar and the answer is yes I think.

I uploaded a public-domain copy of Meditations by Marcus Aurelius and now I feel like I can get direct knowledge from the man himself

https://ibb.co/g7ry4X3

It worked pretty well on the first attempt. Will try putting more authors in it now

Re: Show HN: Customizable, embeddable Chat GPT based on your own documents

#14
post #10

The "Ask Libraria" text field doesn't let me type anything. I tried it with Chrome and Safari on a Mac. Is this intentional?

I also thought it would be interactive and then realized it was just a screenshot. Would be cool to have an interactive demo right there at the top.

Re: Show HN: Customizable, embeddable Chat GPT based on your own documents

#15
post #11

Earlier quoted context omitted.

Oh! I think I understand. So your software takes a prompt from me, does non-GPT work to find additional context from your source (the books, parsed and re-structured into word vectors or whatnot), and then asks GPT my prompt combined with the added context? Like, “What are the three foobars when considering these passages from a book ?”

Yeah more or less! I still use open ai for their embeddings (translating text into vector space) - Your question -> vectors with open ai embeddings - Text you uploaded before -> vectors with open ai embeddings Get the most similar above a certain threshold, and then add it to the prompt saying "From these articles / paragraphs, answer the user's question: What are the three foobars" So yep! I preprocess it

I think that’s a really clever idea.

It feels like training is analogous to years of growing up and going school. And what you’ve done is taken that educated “mind” and said, “here’s a document. I’m going to quiz you on it.”

That seems really practical compared to sending an AI back to school to learn all about some specific topic.

I wonder if we will end up with a library of trained models, each of which went to different schools to obtain different focuses of knowledge. Maybe LiteratureGPT is better suited for this than General GPT or ProgrammerGPT.

Okay I think I’ve stretched the analogy far enough.

Re: Show HN: Customizable, embeddable Chat GPT based on your own documents

#17
post #4

Earlier quoted context omitted.

Oh no! Let me manuially add the 3 unforgivable curses to the library. The way I did the dumbledore demo was upload a PDF for each of the 7 books and there ~might~ not be an explicit section in harry potter that states all of them at once?

> an explicit section in harry potter that states all of them at once? Isn’t part of the point of GPT that it finds relationships without the training data having to be well-structured? So long as the text describes them in a way that a human, having read the books, could answer the question? I don’t really understand how training works. This isn’t a jab.

The GPT models create sequences of words that are likely to be look correct. A side effect is that it sometimes happens to find a connection between ideas. The three unforgivable curses are something that it should be able to connect, as these are all probably in a similar conceptual space, but you would need a fair bit of data to push the model to see that. It's possible to uncover these connections with less data, but with LLMs you need to do things like prompt engineering to give you more leverage on your data if it's limited.

Re: Show HN: Customizable, embeddable Chat GPT based on your own documents

#19

so - if i download a boatload of research papers from scihub about topic X - this will be base its knowledge off them? if so i was just thinking this would be cool to have - and here it is?

Yes. If you do try that, let me know! The most difficult part that i'm encountering right now is the "prompt" engineering part. So I'd be curious to know how I can make it better for you
Post reply on HN