Skip to content

Commit 4534cf0

Browse files
committed
Switched to a pip installable package with automated releases
1 parent bf87a38 commit 4534cf0

File tree

5 files changed

+100
-53
lines changed

5 files changed

+100
-53
lines changed

.github/workflows/release.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Build and Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # Triggers on version tags like v1.0.0
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v4
17+
with:
18+
python-version: '3.9'
19+
20+
- name: Install build tools
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install build
24+
25+
- name: Build package
26+
run: python -m build
27+
28+
- name: Upload wheel to GitHub Release
29+
uses: softprops/action-gh-release@v1
30+
with:
31+
files: dist/*.whl
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 43 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,55 @@
1-
# Benchmarking Tool for NLP Models
1+
# BenchTool
22

3-
A lightweight tool to benchmark the performance of NLP models based on medical text datasets. It supports HuggingFace, ONNX, and ORT models and works with input data from CSV files or a PostgreSQL database.
4-
5-
---
3+
A lightweight tool to benchmark the performance of NLP models based on medical text datasets. Supports HuggingFace, ONNX, and ORT models, and works with input data from CSV files or a PostgreSQL database.
64

5+
## Features
76
- Compare multiple NLP models
87
- Supports HuggingFace, ONNX, and ORT model types
98
- Input from CSV or PostgreSQL database
109
- Outputs performance metrics like inference time and throughput
1110
- Configurable via a single YAML file
1211

13-
---
12+
## Installation
13+
14+
Download the latest release wheel from the [GitHub Releases page](https://github.com/Holmusk/BenchMark/releases) and install with pip:
15+
16+
```sh
17+
pip install https://github.com/Holmusk/BenchMark/releases/download/v1.0.0/benchtool-1.0.0-py3-none-any.whl
18+
```
19+
20+
## Usage
21+
22+
Prepare your `config.yml` and input CSV in your working directory. Then run:
23+
24+
```sh
25+
benchtool
26+
```
27+
28+
## Example `config.yml`
29+
30+
```yaml
31+
model:
32+
name: "dbmdz/bert-large-cased-finetuned-conll03-english"
33+
task: ""
1434

15-
## Installation
35+
input:
36+
mode: "csv"
37+
csv:
38+
path: "100notes.csv"
39+
column: "note_text"
1640

17-
```git clone https://github.com/Holmusk/BenchMark.git```
18-
```cd your-directory```
41+
benchmark:
42+
batch_size: 16
43+
runs: 2
44+
warmup_runs: 1
45+
save_output: true
46+
output_path: "./benchmark_results.csv"
1947

20-
create a virtual environment: ```python3 -m venv Enviornment```\
21-
activate: ```source Enviornment/bin/activate```
48+
system:
49+
device: "cpu"
50+
num_threads: 8
51+
```
2252
23-
To install dependenices: ```pip install -r requirements.txt```
53+
## Notes
54+
- Make sure your `config.yml` and input CSV are in the directory where you run `benchtool`.
55+
- For more details, see the code and comments in the repository.

bench

Lines changed: 0 additions & 17 deletions
This file was deleted.

install.sh

Lines changed: 0 additions & 25 deletions
This file was deleted.

setup.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
from setuptools import setup, find_packages
2+
3+
setup(
4+
name='benchtool',
5+
version='1.0.0',
6+
description='A lightweight tool to benchmark the performance of NLP models based on medical text datasets.',
7+
author='Holmusk',
8+
author_email='varun.c@holmusk.com',
9+
packages=find_packages(include=['utils', 'utils.*']),
10+
py_modules=['main', 'benchmark'],
11+
install_requires=[
12+
r.strip() for r in open('requirements.txt').readlines() if r.strip() and not r.startswith('#')
13+
],
14+
entry_points={
15+
'console_scripts': [
16+
'benchtool = main:main',
17+
],
18+
},
19+
include_package_data=True,
20+
package_data={
21+
'': ['config.yml']
22+
},
23+
python_requires='>=3.7',
24+
)

0 commit comments

Comments
 (0)