Add unittests for Universal Assisted generation#8
Conversation
|
Proposing to include some unittests to ensure functionality. I am, however, encountering some errors in these dummy examples. Any inputs into what this test might be missing? The following is the error I am seeing - |
|
Thanks @gauravjain14 |
It seems the drafter sampled a token that the translator does not include. Perhaps that token is not in the target vocabulary? |
|
@gauravjain14 |
3d7a709 to
e18a060
Compare
|
Rebased on @jmamou's changes in #7. Removed some tests that seemed unnecessary. All tests pass. I have disabled this test for now - Let me know what y'all think about it. If we should have it I can enable it. Disabled due to the context length. |
keyboardAnt
left a comment
There was a problem hiding this comment.
@gauravjain14, thank you, it looks good! I added minor comments.
There was a problem hiding this comment.
No, it takes about 33 seconds on a T4 machine. I think we can just add the tag @slow as mentioned in the comment. Wdyt?
There was a problem hiding this comment.
What about using smaller models? There are a few examples of fast models used in existing Hugging Face tests.
@slow tests run less frequently, so I suggest striving for faster tests.
There was a problem hiding this comment.
@gauravj14 @gauravjain14
Models for testing: https://huggingface.co/hf-internal-testing. For example, hf-internal-testing/tiny-random-gpt2 as used here.
There was a problem hiding this comment.
Wdyt about moving the content of this file to tests/generation/test_candidate_generator.py?
|
Here's a quick update - I am running the test 'test_mismatched_vocabularies
|
According to the target tokenizer, |
Got it. Thanks for the quick response on that. So, how do you propose we handle this for now? Should we skip special tokens in the target vocab or you think this will be a quick fix? |
Let's skip special tokens for now. Note that UAG does not handle that case also. |
8e3d814 to
1a7f420
Compare
1a7f420 to
2652490
Compare
keyboardAnt
left a comment
There was a problem hiding this comment.
LGTM. I only added two small comments.
…ate_generator.py`
| import weakref | ||
| from unittest.mock import MagicMock | ||
|
|
||
| from zmq import device |
Introduce Unit tests for Universal Assisted Generation
tests/test_universal_assisted_generation.pyis intended to test the functionality introduced by universal assisted generation.Note: All but
test_basic_generationhave been disabled for now.Who can review?
@keyboardAnt @jmamou