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

Finetuning API issue. Non-helpful Error Message (Internal Server Error) #400

Open
ChaosSamKo opened this issue Jan 17, 2025 · 0 comments
Open

Comments

@ChaosSamKo
Copy link

ChaosSamKo commented Jan 17, 2025

With the new finetuning API, and the Python script provided I get this issue when requesting the Finetuning progress after it (seemingly successfully) started and gave me an ID:

import os
import base64
import requests

def finetune_progress(
    finetune_id,
    api_key=None,
):
    if api_key is None:
        if "BFL_API_KEY" not in os.environ:
            raise ValueError(
                "Provide your API key via --api_key or an environment variable BFL_API_KEY"
            )
        api_key = os.environ["BFL_API_KEY"]
    url = "https://api.us1.bfl.ai/v1/get_result"
    headers = {
        "Content-Type": "application/json",
        "X-Key": api_key,
    }
    payload = {
        "id": finetune_id,
    }

    response = requests.get(url, headers=headers, params=payload)
    try:
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        raise requests.exceptions.RequestException(
            f"Finetune progress failed:\n{str(e)}\n{response.content.decode()}"
        )


python finetune.py finetune_progress XXXX

Traceback (most recent call last):
File "XXX\flux-api\finetune.py", line 146, in finetune_progress
response.raise_for_status()
File "XXX\flux-api.venv\lib\site-packages\requests\models.py", line 1024, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: https://api.us1.bfl.ai/v1/get_result?id=7781c441-1ef3-4841-9876-d6cad4691a61
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "XXX\flux-api\finetune.py", line 305, in
fire.Fire()
File "XXX\flux-api.venv\lib\site-packages\fire\core.py", line 135, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
File "XXX\flux-api.venv\lib\site-packages\fire\core.py", line 468, in _Fire
component, remaining_args = _CallAndUpdateTrace(
File "XXX\flux-api.venv\lib\site-packages\fire\core.py", line 684, in _CallAndUpdateTrace
component = fn(*varargs, **kwargs)
File "XXX\flux-api\finetune.py", line 149, in finetune_progress
raise requests.exceptions.RequestException(
requests.exceptions.RequestException: Finetune progress failed:
500 Server Error: Internal Server Error for url: https://api.us1.bfl.ai/v1/get_result?id=7781c441-1ef3-4841-9876-d6cad4691a61
{"id":"XXXXX-XXXX-XXX-XXXXX-XXXXXX","status":"Error","result":null,"progress":null}

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