-
Notifications
You must be signed in to change notification settings - Fork 0
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
Tests are implemented #13
Conversation
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.
Having the right in/out type annotations in generate
method is critical. Everything else has to be fleshed out around that, not the other way around.
@@ -26,4 +26,4 @@ def generate(self, body) -> AutomaticSpeechRecognitionResponse: | |||
response = self.client.post( | |||
form_data, {"headers": {"content-type": form_data.content_type}} | |||
) | |||
return AutomaticSpeechRecognitionResponse(**response.json()) | |||
return response.json() |
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.
Why do you remove the conversion to the ASRResponse? Now the annotation is wrong (this is not C++, it won't auto-call the constructor or anything).
deepinfra/models/base/embeddings.py
Outdated
@@ -15,4 +15,4 @@ def generate(self, body) -> EmbeddingsResponse: | |||
:return: | |||
""" | |||
response = self.client.post(body) | |||
return EmbeddingsResponse(**response.json()) | |||
return response.json() |
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.
Same here.
@@ -23,4 +23,4 @@ def generate(self, body: dict) -> TextGenerationResponse: | |||
:return: | |||
""" | |||
response = self.client.post(body) | |||
return TextGenerationResponse(**response.json()) | |||
return response.json() |
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.
Same here
@@ -16,4 +16,4 @@ def generate(self, input): | |||
""" | |||
body = {"input": input} | |||
response = self.client.post(body) | |||
return TextToImageResponse(**response.json()) | |||
return response.json() |
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.
Same here. You also don't have annotation in the generate method.
You can use template-like specialization in inheritance, so the generate method won't complain it has a different signature, if that is the problem.
|
No description provided.