-
Notifications
You must be signed in to change notification settings - Fork 149
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
enh: Update Predibase integration to support v2 API #403
Conversation
raise RuntimeError(f"Adapter {model_id} is not yet available") | ||
return path | ||
else: | ||
# Use legacy path only since new endpoint requires both name and version number. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this code is identical to 54:58. Can we pull it into a function?
def fetch_legacy_url(legacy_url):
resp = requests.get(legacy_url, headers=headers)
resp.raise_for_status()
uuid, best_run_id = resp.json()["uuid"], resp.json()["bestRunID"]
return f"{uuid}/{best_run_id}/artifacts/model/model_weights/"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
return f"{uuid}/{best_run_id}/artifacts/model/model_weights/" | ||
|
||
if url is not None: | ||
try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just trying to think about this in terms of customer impact: we really only expect staging to use this for the next few days until we migrate all of LLM Models to the Adapters table and a very brief window in Prod while we migrate the data right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Predibase is releasing a new API for working with and retrieving adapters. This PR updates Lorax's Predibase integration to prefer the new API, falling back to the legacy endpoints to maintain backwards compatibility during the transition period.