-
Notifications
You must be signed in to change notification settings - Fork 11.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crafting prompts to get LLaMA models to generate interesting content #156
Comments
This is normal behavior try adding -i -r "User" to stop text generation and let you add your own text after it hits the reverse token. You probably need to give the model more context to get the desired order of output, try this:
Don't expect miracles from the 7B model. It has a good sense of humor though :) |
Im have some questions. There is a way to create a model like the 7B to pass my catalog of books and make questions to my books for example? If yes, do you have any example? |
You would need GPU with tens of gigs of VRAM and use another fork. |
When you say "use another fork" you mean that llama.cpp only works with Facebook LLAMA data and cannot train other dataset? |
llama.cpp is made only for inference, it doesn't have training functionality. It wouldn't make sense to do that on CPU for model of that size anyways. Meta didn't release LLaMa training code, but, AFAIK, there is at least one alternative implementation of training code, you should use those. |
nothing is strange about that input and the bot mimicking it and giving you output. Nothing at all, this is how all language models act. I just answered this thread: as posted in that reply issue 71 makes this greatly less usable and until that issue is fixed, chat mode is basically unusable for more than like 2 questions. also close threads if your issues are resolved.
llama cpp is only for llama.. and written in C++, and only for CPU. and only for running the models.
after issue 71 is fixed, you can do that sure. Write all the questions and answers to them that exist for your catalog. I suggest you take your time doing that now. The more questions and answers you have, the more exact it'll be. |
Nice. So, if i understand, the llama it self don't have all contents indexed to we make questions, but instead it is trained to "understand" my contents using that input file (-f prompts.txt) that i can train it with my data and the "7B" data make it understand my content as sentences to be answered. Is this? |
You can "prime the model" by engineering prompts for it to respond to. This is not training but nudging the model into generating a narrative that is relevant to your problem. One way I prime ChatGPT is by starting with:
The model will then generate a description of what a rocket scientist does. It is primed to "think about rocket science". Then continue the rocket science narrative with the next question:
Now you get a rocket scientist's answer to how she would build a rocket to get to Mars. Note that ChatGPT has been fine-tuned to follow your instructions. LLaMA has not, therefore you need to help it by prompting it with the sort of answers you desire. |
Yea it's a language model that just predicts what comes next https://en.wikipedia.org/wiki/Language_model |
Nice. To a more real scenario, if i want input all the bible text into the LLAMA, how that .txt file need be created to it "understand" that context and i can make questions? Example of bible data: Since we cant training the LLAMA but can make reverse process inputing data on it how we can put the full King James Bible version on it ^? And if i make a mobile app, for each question i will need load the .TXT with the "questions" to be inputed on LLAMA, correct? And after a field to the user make their question and capture the answer. |
Be aware, it isn't going to search the Bible, it is instead generating potentially fictional Bible content. You need to carefully consider the ethical religious consequences of such an app. With that caveat, prompt it with something like:
Then:
This might get it primed to narrating/generating in the style of the King James version and in the context of the Old Testament. Then:
And you might get some pseudo-prophet output about God from the imaginary prophet Xanomander. I would prototype this with ChatGPT. Once you have a useful prompt which defines the King James Bible and Old Testament, try ChatGPT's definitions as the prompt for LLaMA. In terms of integration, you'd hardcode your initial engineered prompt (i.e. ChatGPT's definitions) and then append the Q's you want to answer about the Bible. |
Hi, I understand and as i sad, it si an experiment. It don't will "search in bible" today, but i can input the bible content to it learn about the bible verses and make questions about the bible verses? One real example. File: bible.txt
Execution:
As you can see, this is perfect. |
What i need now is understand how i can "trainining" the "bible.txt" to load it already trained instead of this reverse form. |
You can just directly ask it questions about specific chapters of the bible. You can assume it knows the bible as it has read (i.e. been trained on) Gutenberg. Whether the answers are useful is another matter:
|
The bible is only an example man, i want understand it background with common data. People may want input their own content. I have some questions: First: How i can "training" the "bible.txt" to load it already trained instead of this reverse form (or any other content). Second: How can i put the prompt in the execution instead of use interactive mode? Before:
After:
|
The prompt is the only content you can provide. The rest is up to the knowledge already stored in the model (e.g. bibles or rockets). Either your user has to provide the prompt, or if you want to prime the model to discuss a specific topic you need to use the I think you need to read more about how pre-trained LLMs work. Have you used ChatGPT? Also, the command line interface you are using is not suited to direct integration into an app. Maybe wait until some |
Closing this as the questions aren't really specific to |
I'd say it's worse than the phone. It should be clarified that this specific model is geared towards generating (continuation of a) content, not towards chat or towards adventure mode like say KoboldAI's OPT/GPT/Neo/FSD models (although there are efforts to run llama there and someone has written a transformer already, but I think people will be disappointed once they get to try it). It should also be clarified that many input characters need to be escaped if you don't want the model to just quit in the middle of the interactive mode. |
Hi,
Im getting a strange behaviour and answer:
Answer:
How i can get only one answer and a time?
There is a more precise model than 7B?
There is portuguese/brazil support in languages to question/answer?
The text was updated successfully, but these errors were encountered: