Skip to content
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

Gemini Flash runs very slow (1 it/s) #223

Closed
RyanMarten opened this issue Dec 6, 2024 · 4 comments
Closed

Gemini Flash runs very slow (1 it/s) #223

RyanMarten opened this issue Dec 6, 2024 · 4 comments
Assignees

Comments

@RyanMarten
Copy link
Contributor

Only doing one request at a time

Screenshot 2024-12-05 at 10 43 36 PM

@CharlieJCJ
Copy link
Contributor

CharlieJCJ commented Dec 10, 2024

What happened here was that 1) we've set a slow default tpm, which is 150k, and 2) we did a conservative output token estimation, which doesn't exhaust the token capacity.
Related issues: #206

The fix for this is manually set the tpm to a higher value. I'll followup with a higher default tpm.

@CharlieJCJ
Copy link
Contributor

Example script

from bespokelabs.curator import Prompter
from datasets import Dataset
import logging

logger = logging.getLogger("bespokelabs.curator")
logger.setLevel(logging.DEBUG)

dataset = Dataset.from_dict({"prompt": ["write me a poem"] * 100_000})

prompter = Prompter(
    prompt_func=lambda row: row["prompt"],
    model_name="gemini/gemini-1.5-flash-002",
    response_format=None,
    max_requests_per_minute=2000,
    max_tokens_per_minute=4000000,
)

dataset = prompter(dataset)
print(dataset.to_pandas())

@CharlieJCJ
Copy link
Contributor

Also works for gemini-1.5-pro-002

@CharlieJCJ
Copy link
Contributor

gemini-1.5-pro-002
image

gemini-1.5-flash-002
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants