How to pass in multiple inputs at once? #3222
-
Hello, I'm trying to use llama.cpp for text summarization on my dataset of >100,000 .txt files. I see that there is an option (-f) which lets the model read input from a file. Is it possible to process multiple files at once? How does this relate to the batch_size option (-b)? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Not at the moment, but most models have a context limit around 4096 tokens - that includes the prompt and the output. You're not thinking you can feed all those files to a model and get an overall summary, right? If not, you can just make a simple script that calls |
Beta Was this translation helpful? Give feedback.
-
I'm interested in batch inference as well. 4096/384 = 10.6 |
Beta Was this translation helpful? Give feedback.
@novice03
On Unix-type OSes this is really easy. You wouldn't want to do it quite this simply, but just as an example:
That'll work with
sh
compatible shells like bash, zsh, etc and just runsmain
on every text file in the current directory, saving the output fromstdout
to "filename.txt.out" and output fromstderr
to "filename.txt.err".GPU is generally going to be a lot faster than CPU. Also even GPUs without a lot of memory can still speed up prompt processing a lot. Assuming you…