Skip to content
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

Merged
merged 7 commits into from
May 6, 2024
Merged

Tests are implemented #13

merged 7 commits into from
May 6, 2024

Conversation

ovuruska
Copy link
Owner

No description provided.

@ovuruska ovuruska self-assigned this Apr 29, 2024
@ovuruska ovuruska linked an issue Apr 29, 2024 that may be closed by this pull request
@ovuruska ovuruska marked this pull request as ready for review April 30, 2024 09:13
Copy link
Collaborator

@ichernev ichernev left a 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()
Copy link
Collaborator

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).

@@ -15,4 +15,4 @@ def generate(self, body) -> EmbeddingsResponse:
:return:
"""
response = self.client.post(body)
return EmbeddingsResponse(**response.json())
return response.json()
Copy link
Collaborator

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()
Copy link
Collaborator

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()
Copy link
Collaborator

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.

Copy link

sonarqubecloud bot commented May 4, 2024

Quality Gate Passed Quality Gate passed

Issues
1 New issue
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@ovuruska ovuruska merged commit f8731c2 into main May 6, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unit tests pipeline
2 participants