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

OpenAI Online no key halts #236

Closed
CharlieJCJ opened this issue Dec 10, 2024 · 2 comments
Closed

OpenAI Online no key halts #236

CharlieJCJ opened this issue Dec 10, 2024 · 2 comments

Comments

@CharlieJCJ
Copy link
Contributor

CharlieJCJ commented Dec 10, 2024

After #234, this happens

Minimal Reproduce

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})

prompter = Prompter(
    prompt_func=lambda row: row["prompt"],
    model_name="gpt-4o-mini",
    response_format=None,
)

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

without passing in a key, it halts...

(bespokelabs-curator-py3.12) (base) ➜  bella git:(dev) ✗ python examples/big.py 
2024-12-10 09:57:46,384 - bespokelabs.curator.prompter.prompter - INFO - Requesting text output from gpt-4o-mini, using OpenAI backend
2024-12-10 09:57:46,384 - bespokelabs.curator.request_processor.base_request_processor - DEBUG - Adjusting file descriptor limit from 1048576 to 1048576 (hard limit: 1048576)
2024-12-10 09:57:46,385 - bespokelabs.curator.prompter.prompter - DEBUG - Curator Cache Fingerprint String: 20127c6e62fd7298_e2caa4a2ecc553dc_gpt-4o-mini_text_False_openai
2024-12-10 09:57:46,385 - bespokelabs.curator.prompter.prompter - DEBUG - Curator Cache Fingerprint: 4d0c2e9c9ff55370
2024-12-10 09:57:46,389 - bespokelabs.curator.request_processor.base_online_request_processor - INFO - Running OpenAIOnlineRequestProcessor completions with model: gpt-4o-mini
2024-12-10 09:57:46,390 - bespokelabs.curator.request_processor.base_request_processor - INFO - Using cached requests. If you want to regenerate the dataset, disable or delete the cache.
2024-12-10 09:57:46,390 - bespokelabs.curator.request_processor.base_request_processor - DEBUG - There are 100 existing requests in /home/charlieji/.cache/curator/4d0c2e9c9ff55370/requests_0.jsonl
Example request in /home/charlieji/.cache/curator/4d0c2e9c9ff55370/requests_0.jsonl:
{
  "model": "gpt-4o-mini",
  "messages": [
    {
      "role": "user",
      "content": "write me a poem"
    }
  ],
  "response_format": null,
  "original_row": {
    "prompt": "write me a poem"
  },
  "original_row_idx": 0
}
2024-12-10 09:57:46,485 - bespokelabs.curator.request_processor.base_online_request_processor - WARNING - No manual max_tokens_per_minute set, and headers based detection failed, using default value of 1000
2024-12-10 09:57:46,486 - bespokelabs.curator.request_processor.base_online_request_processor - WARNING - No manual max_requests_per_minute set, and headers based detection failed, using default value of 10
Processing OpenAIOnlineRequestProcessor requests:   0%|                                                                                                              | 0/100 [00:00<?, ?it/s]
@CharlieJCJ
Copy link
Contributor Author

The reason of halt is that after key isn't passed in, it uses default values that are too low.

The "too low" default values is resolved in #245

@CharlieJCJ
Copy link
Contributor Author

The key not passed in, got a better raise exception in #237

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

1 participant