Batching #9

Closed
opened 2026-02-15 16:27:25 -05:00 by yindo · 3 comments
Owner

Originally created by @varunshenoy on GitHub (Jan 25, 2024).

Is there any way to batch prompts with local models using this package? Thank you!

Originally created by @varunshenoy on GitHub (Jan 25, 2024). Is there any way to batch prompts with local models using this package? Thank you!
yindo closed this issue 2026-02-15 16:27:25 -05:00
Author
Owner

@mxyng commented on GitHub (Jan 25, 2024):

Can you describe what you're trying to do? I'm not sure I understand

@mxyng commented on GitHub (Jan 25, 2024): Can you describe what you're trying to do? I'm not sure I understand
Author
Owner

@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 transformers library that explains how they support batching:
SCR-20240125-lbxs

@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 `transformers` library that explains how they support batching: <img width="905" alt="SCR-20240125-lbxs" src="https://github.com/ollama/ollama-python/assets/10859091/c82b6f01-73bb-4acd-ae66-1a3d70945dce">
Author
Owner

@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.

@mxyng commented on GitHub (Jan 26, 2024): This issue would be more appropriate for [ollama](https://github.com/ollama/ollama) since this repo is only the python interface to the ollama API.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ollama/ollama-python#9