mirror of
https://github.com/ollama/ollama-python.git
synced 2026-07-21 09:05:23 -04:00
Batching #9
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @varunshenoy on GitHub (Jan 25, 2024).
Is there any way to batch prompts with local models using this package? Thank you!
@mxyng commented on GitHub (Jan 25, 2024):
Can you describe what you're trying to do? I'm not sure I understand
@varunshenoy commented on GitHub (Jan 25, 2024):
Suppose I have a list of prompts: ["A list of colors: red, blue", "Geckos eat", "The capital of France is"]
You can run these all through an LLM in a single forward pass with a little to no latency hit due to the inherent parallelism in transformers. Mainly used for inference servers with multiple people hitting it at the same time, but I want to see if I can speed up some local workflows.
Here's some documentation from Hugging Face's

transformerslibrary that explains how they support batching:@mxyng commented on GitHub (Jan 26, 2024):
This issue would be more appropriate for ollama since this repo is only the python interface to the ollama API.