Add token sampling (temperature, top-k, top-p) for GPT-2 generation#33
Draft
neegovindan wants to merge 1 commit intogovindansriram:mainfrom
Draft
Add token sampling (temperature, top-k, top-p) for GPT-2 generation#33neegovindan wants to merge 1 commit intogovindansriram:mainfrom
neegovindan wants to merge 1 commit intogovindansriram:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #26 by adding non-greedy token selection for generation.
Acceptance Criteria Mapping
Changes
Added
Notes
Validation
Compiling '/Users/ngovindan/Documents/Work/app/cobraml/CobraMLng/setup.py'...
Listing '/Users/ngovindan/anaconda3/lib/python311.zip'...
Can't list '/Users/ngovindan/anaconda3/lib/python311.zip'
Listing '/Users/ngovindan/anaconda3/lib/python3.11'...
Compiling '/Users/ngovindan/anaconda3/lib/python3.11/_sysconfigdata_x86_64_apple_darwin13_4_0.py'...
Listing '/Users/ngovindan/anaconda3/lib/python3.11/lib-dynload'...
Listing '/Users/ngovindan/anaconda3/lib/python3.11/site-packages'...
Compiling '/Users/ngovindan/anaconda3/lib/python3.11/site-packages/pycurl.py'...
Listing '/Users/ngovindan/anaconda3/lib/python3.11/site-packages/aeosa'... on all modified Python files passed.
platform darwin -- Python 3.11.3, pytest-7.3.1, pluggy-1.0.0
rootdir: /Users/ngovindan/Documents/Work/app/cobraml/CobraMLng
configfile: pyproject.toml
testpaths: python/tests
plugins: anyio-3.5.0, hydra-core-1.3.2
collected 0 items / 3 errors
==================================== ERRORS ====================================
____________ ERROR collecting python/tests/layers/test_attention.py ____________
ImportError while importing test module '/Users/ngovindan/Documents/Work/app/cobraml/CobraMLng/python/tests/layers/test_attention.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../../../anaconda3/lib/python3.11/importlib/init.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
python/tests/layers/test_attention.py:2: in
from cobraml.layers import MultiHeadAttention, FusedMultiHeadAttention
E ModuleNotFoundError: No module named 'cobraml'
_____________ ERROR collecting python/tests/models/test_gpt2-xl.py _____________
ImportError while importing test module '/Users/ngovindan/Documents/Work/app/cobraml/CobraMLng/python/tests/models/test_gpt2-xl.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../../../anaconda3/lib/python3.11/importlib/init.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
python/tests/models/test_gpt2-xl.py:1: in
from cobraml.utils import load_hf_config
E ModuleNotFoundError: No module named 'cobraml'
____________ ERROR collecting python/tests/models/test_sampling.py _____________
ImportError while importing test module '/Users/ngovindan/Documents/Work/app/cobraml/CobraMLng/python/tests/models/test_sampling.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../../../anaconda3/lib/python3.11/importlib/init.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
python/tests/models/test_sampling.py:4: in
from cobraml.models import sample_next_token
E ModuleNotFoundError: No module named 'cobraml'
=========================== short test summary info ============================
ERROR python/tests/layers/test_attention.py
ERROR python/tests/models/test_gpt2-xl.py
ERROR python/tests/models/test_sampling.py
!!!!!!!!!!!!!!!!!!! Interrupted: 3 errors during collection !!!!!!!!!!!!!!!!!!!!
============================== 3 errors in 10.81s ============================== could not be run in this environment due a local torch import/runtime abort.