refactor(huggingface,-anthropic,-replicate,-sagemaker): making huggingface, anthropic, replicate, sagemaker compatible openai v1 sdk

This commit is contained in:
Krrish Dholakia 2023-11-11 17:38:15 -08:00
parent 547598a134
commit 4f42beb9d9
4 changed files with 11 additions and 2 deletions

View file

@ -14,8 +14,8 @@ class HuggingfaceError(Exception):
def __init__(self, status_code, message):
self.status_code = status_code
self.message = message
self.response = httpx.Response(status_code=status_code)
self.request = self.response.request
self.request = httpx.Request(method="POST", url="https://api-inference.huggingface.co/models")
self.response = httpx.Response(status_code=status_code, request=self.request)
super().__init__(
self.message
) # Call the base class constructor with the parameters it needs