-
Notifications
You must be signed in to change notification settings - Fork 22
update load #53
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
update load #53
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,7 +22,7 @@ async def verify_request_token(request: Request, call_next): | |
| Returns: | ||
| JSONResponse with error if validation fails, otherwise the response from call_next | ||
| """ | ||
| authorization = request.headers.get("Authorization") | ||
| authorization = request.headers.get("Twinkle-Authorization") | ||
| token = authorization[7:] if authorization and authorization.startswith("Bearer ") else authorization | ||
| if not is_token_valid(token): | ||
|
Comment on lines
+25
to
27
|
||
| return JSONResponse(status_code=403, content={"detail": "Invalid token"}) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,6 +29,7 @@ def init_tinker_compat_client(base_url: Optional[str] = None, api_key: Optional[ | |
| default_headers = { | ||
| "X-Ray-Serve-Request-Id": get_request_id(), | ||
| "Authorization": 'Bearer ' + api_key, | ||
| "Twinkle-Authorization": 'Bearer ' + api_key, # For server compatibility | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With the addition of the |
||
| } | kwargs.pop("default_headers", {}) | ||
|
|
||
| service_client = ServiceClient(base_url=base_url, api_key=api_key, default_headers=default_headers, **kwargs) | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -17,6 +17,7 @@ def _build_headers(additional_headers: Optional[Dict[str, str]] = None) -> Dict[ | |||||||||||||||||||
| headers = { | ||||||||||||||||||||
| "X-Ray-Serve-Request-Id": get_request_id(), | ||||||||||||||||||||
| "Authorization": 'Bearer ' + get_api_key(), | ||||||||||||||||||||
| "Twinkle-Authorization": 'Bearer ' + get_api_key(), # For server compatibility | ||||||||||||||||||||
|
Comment on lines
17
to
+20
|
||||||||||||||||||||
| headers = { | |
| "X-Ray-Serve-Request-Id": get_request_id(), | |
| "Authorization": 'Bearer ' + get_api_key(), | |
| "Twinkle-Authorization": 'Bearer ' + get_api_key(), # For server compatibility | |
| api_key = get_api_key() | |
| headers = { | |
| "X-Ray-Serve-Request-Id": get_request_id(), | |
| "Authorization": 'Bearer ' + api_key, | |
| "Twinkle-Authorization": 'Bearer ' + api_key, # For server compatibility |
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.
resolve_load_pathnow returns the parent ofget_ckpt_dir(...)(theweights/orsampler_weights/directory) rather than the specific checkpoint directory. This behavior is likely correct for callers that doos.path.join(output_dir, name), but the variable namecheckpoint_dirand surrounding docstrings/comments become misleading. Please clarify the contract (e.g., document that this is the "output_dir" root) to avoid future misuse.