Skip to content

Commit

Permalink
added cuda flag for GPU prediction
Browse files Browse the repository at this point in the history
Signed-off-by: Zethson <[email protected]>
  • Loading branch information
Zethson committed Aug 29, 2020
1 parent 0aa639d commit 74f7241
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .cookietemple.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ full_name: Lukas Heumos
email: [email protected]
project_name: lcep-package
project_short_description: Python package for lcep.
version: 1.1.0
version: 1.2.0
license: MIT
command_line_interface: Click
testing_library: pytest
13 changes: 13 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ Changelog

This project adheres to `Semantic Versioning <https://semver.org/>`_.

1.2.0 (2020-08-28)
------------------

**Added**

* Added flag --cuda and --no-cuda to enable and disable GPU prediction

**Fixed**

**Dependencies**

**Deprecated**


1.1.0 (2020-08-28)
------------------
Expand Down
2 changes: 1 addition & 1 deletion cookietemple.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.1.0
current_version = 1.2.0

[bumpversion_files_whitelisted]
setup_file = setup.py
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@
# the built documents.
#
# The short X.Y version.
version = '1.1.0'
version = '1.2.0'
# The full version, including alpha/beta/rc tags.
release = '1.1.0'
release = '1.2.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion lcep_package/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

__author__ = """Lukas Heumos"""
__email__ = '[email protected]'
__version__ = '1.1.0'
__version__ = '1.2.0'
5 changes: 4 additions & 1 deletion lcep_package/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
@click.command()
@click.option('-i', '--input', required=True, type=str, help='Path to data file to predict.')
@click.option('-m', '--model', type=str, help='Path to an already trained XGBoost model. If not passed a default model will be loaded.')
@click.option('-c/-nc', '--cuda/--no-cuda', type=bool, default=False, help='Whether to enable cuda or not')
@click.option('-o', '--output', type=str, help='Path to write the output to')
def main(input: str, model: str, output: str):
def main(input: str, model: str, cuda: bool, output: str):
"""Console script for lcep-package."""
print(r"""[bold blue]
██  ██████ ███████ ██████ 
Expand All @@ -32,6 +33,8 @@ def main(input: str, model: str, output: str):
model = get_xgboost_model(f'{WD}/models/model_28.08.2020_v1.xgb')
else:
model = get_xgboost_model(model)
if cuda:
model.set_param({'predictor': 'gpu_predictor'})
print('[bold blue] Parsing data')
data_to_predict = read_data_to_predict(input)
print('[bold blue] Performing predictions')
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,6 @@ def walker(base, *paths):
test_suite='tests',
tests_require=test_requirements,
url='https://github.com/mlf-core/lcep-package',
version='1.1.0',
version='1.2.0',
zip_safe=False,
)

0 comments on commit 74f7241

Please sign in to comment.