-
Notifications
You must be signed in to change notification settings - Fork 5
feat: Inference mock #29
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
Conversation
Signed-off-by: Emilio Garcia <[email protected]>
Signed-off-by: Emilio Garcia <[email protected]>
Signed-off-by: Emilio Garcia <[email protected]>
Signed-off-by: Emilio Garcia <[email protected]>
Signed-off-by: Emilio Garcia <[email protected]>
9f86c66 to
36635e8
Compare
Signed-off-by: Emilio Garcia <[email protected]>
Signed-off-by: Emilio Garcia <[email protected]>
|
reference passing test job: instructlab/examples#22 |
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.
Nice. Can we add unit tests for these new scripts in case others want to contribute to them in the future?
Signed-off-by: Emilio Garcia <[email protected]>
e19174d to
ba12a30
Compare
Signed-off-by: Emilio Garcia <[email protected]>
Signed-off-by: Emilio Garcia <[email protected]>
Signed-off-by: Emilio Garcia <[email protected]>
ktdreyer
left a comment
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.
In the future I think we should use pytest's newer style tests instead of unittest.
You can switch the old-style unittest asserts to use bare assert statements. For example like self.assertIsInstance can be assert isinstance(...) . pytest will give you rich assertion logs when things fail.
The current implementation is ok and I'll approve here.
can you link me a guide on it? I am not super familiar with whats current in testing in python. I spent the last 8 years doing Go exclusively, so this is kinda new to me |
Signed-off-by: Emilio Garcia <[email protected]>
|
https://docs.pytest.org/en/stable/getting-started.html is a great introduction. Here are the changes I recommend to switch this code to pytest:
Now that GHA is running the tests with pytest, you can clean up the
with pytest.raises(ValueError):
to_match(invalid_pattern)
if __name__ == "__main__":
unittest.main() |
|
Thanks! I will make a follow up PR and fix this up! 🚀 |
courtneypacheco
left a comment
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.
Nice work! Looks great! Sorry I didn't get to review this right away.
A very basic Open AI "Like" completions API server for mocking.
Something to note: OpenAI Like completion responses are based on the legacy completions APIs, and are not compatible with the latest OpenAI completions APIs