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

[WIP] Unit test with random seed failure #909

Merged
merged 2 commits into from
Jul 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions engines/python/setup/djl_python/tests/test_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,14 @@ def test_sampling_scheduler(self):

results = scheduler.collect_results()

# assert tokenizer.decode(results[1][:30]) == "When your legs don't work like they used to before And I can't " \
# "sweep you off your feet, you're right, I'm done for the"
assert tokenizer.decode(results[2][:30]) == "There's a time that I remember, when I did not know what to do " \
"with my life. I was in a very bad mood. I was"
# assert tokenizer.decode(results[0][:30]) == "Memories follow me left and right. I can't help but feel that " \
# "I've been given a chance to do something different. I've been told"

for i, ret in results.items():
print('\n{}:'.format(i), tokenizer.decode(ret))
assert tokenizer.decode(results[0][:30]) == "Memories follow me left and right. I can't remember the last " \
"time I had to do this, and I'm glad that I did.\n"
assert tokenizer.decode(
results[1][:30]
) == """When your legs don't work like they used to before And I can't sweep you off your face" one female announced... " Everyone seems"""
assert tokenizer.decode(
results[2][:30]
) == "There's a time that I remember, when I did not know what to do with my life. I was in a very bad mood. I was"

def test_contrastive_scheduler(self):
model_id = "gpt2"
Expand Down