Content-Length: 272342 | pFad | https://github.com/googleapis/python-aiplatform/commit/c72c1ef4c58c79fd7a0ee4064de7f2f4a4257f36

DF fix: Made `Endpoint.raw_predict` thread-safe by setting `authorized_s… · googleapis/python-aiplatform@c72c1ef · GitHub
Skip to content

Commit c72c1ef

Browse files
calvingilescopybara-github
authored andcommitted
fix: Made Endpoint.raw_predict thread-safe by setting authorized_session last
Fixes: #2068 Closes: #3385 COPYBARA_INTEGRATE_REVIEW=#3385 from calvingiles:make_raw_predict_threadsafe fa2c719 PiperOrigin-RevId: 616187206
1 parent ab5fd4d commit c72c1ef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

google/cloud/aiplatform/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1687,10 +1687,10 @@ def raw_predict(
16871687
"""
16881688
if not self.authorized_session:
16891689
self.credentials._scopes = constants.base.DEFAULT_AUTHED_SCOPES
1690+
self.raw_predict_request_url = f"https://{self.location}-{constants.base.API_BASE_PATH}/v1/projects/{self.project}/locations/{self.location}/endpoints/{self.name}:rawPredict"
16901691
self.authorized_session = google_auth_requests.AuthorizedSession(
16911692
self.credentials
16921693
)
1693-
self.raw_predict_request_url = f"https://{self.location}-{constants.base.API_BASE_PATH}/v1/projects/{self.project}/locations/{self.location}/endpoints/{self.name}:rawPredict"
16941694

16951695
return self.authorized_session.post(
16961696
url=self.raw_predict_request_url, data=body, headers=headers

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/googleapis/python-aiplatform/commit/c72c1ef4c58c79fd7a0ee4064de7f2f4a4257f36

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy