Repository navigation
runtime: accept a config object in the download endpoints - #1977
Open
Daksha1611 wants to merge 1 commit into
Open
Daksha1611 wants to merge 1 commit into
Daksha1611 wants to merge 1 commit into
Conversation
Signed-off-by: Daksha1611 <mehtadaksha1611@gmail.com>
Contributor
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Contributor
|
Welcome @Daksha1611! It looks like this is your first PR to volcano-sh/kthena 🎉 |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
/kind bug
What this PR does / why we need it:
/v1/download_modeland/v1/load_lora_adapterdocumentconfigas a JSON object, but any non-empty object returns HTTP 500 becauseload_configpasses it tojson.loads.This PR makes
load_configaccept a dict as well as a JSON string. The CLI continues to pass a string. The dict is copied so that the request body is not modified. Values that are not objects now raiseValueErrorwith a clear message.Which issue(s) this PR fixes:
Fixes #1976
Bug evidence (required for bug-related PRs):
Requests sent over HTTP to the runtime server started with
python -m kthena.runtime.app, using a localpvc://source.configvalue{}{"hf_token":"dummy"}"{\"hf_token\":\"dummy\"}"123the JSON object must be str, bytes or bytearray, not intInvalid configuration JSON format.Error before the fix:
This was reproduced locally and not on a cluster.
/v1/load_lora_adapterwas covered through the FastAPI test client rather than a running server.Special notes for your reviewer:
A value that is not an object still returns HTTP 500 because the handlers map every exception to 500. Returning 400 would be a separate change, and I have kept it out of this PR.
Testing:
pytest python/kthena/tests(125 passed, Python 3.12) andruff check . --config python/kthena/pyproject.toml. Eight of the new tests fail without the fix.Does this PR introduce a user-facing change?: