Skip to content

Commit

Permalink
Merge pull request #68 from jbusche/jb-dependency-issue56
Browse files Browse the repository at this point in the history
Switches dependencies from txt file to toml file
  • Loading branch information
gkumbhat authored Mar 27, 2024
2 parents 945730b + a25ef3f commit 4cc09cb
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 20 deletions.
1 change: 0 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ The following tools are required:

Installation:
```
pip install -r requirements.txt
pip install -U datasets
pip install -e .
```
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ This repo provides basic tuning scripts with support for specific models. The re
## Installation

```
pip install -r requirements.txt
pip install -U datasets
pip install -e .
```

> Note: If you wish to use [FlashAttention](https://github.com/Dao-AILab/flash-attention), then you need to install these requirements: `pip install -r flashattn_requirements`. [FlashAttention](https://github.com/Dao-AILab/flash-attention) requires the [CUDA Toolit](https://developer.nvidia.com/cuda-toolkit) to be pre-installed.
> Note: After installing, if you wish to use [FlashAttention](https://github.com/Dao-AILab/flash-attention), then you need to install these requirements:
'''
pip install -e ".[dev]"
pip install -e ".[flash-attn]"
```
[FlashAttention](https://github.com/Dao-AILab/flash-attention) requires the [CUDA Toolit](https://developer.nvidia.com/cuda-toolkit) to be pre-installed.
## Data format
The data format expectation is a single column text. The trainer is configured to expect a response template as a string. For example, if one wants to prepare the `alpaca` format data to feed into this trainer, it is quite easy and can be done with the following code.
Expand Down
14 changes: 5 additions & 9 deletions build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,14 @@ RUN dnf install -y python3.11 git && \
RUN mkdir /app

WORKDIR /tmp
RUN python -m pip install packaging && \
python -m pip install --upgrade pip && \
python -m pip install torch && \
python -m pip install wheel
RUN python -m pip install --upgrade pip

# TODO Move to installing wheel once we have proper releases setup instead of cloning the repo
RUN git clone https://github.com/foundation-model-stack/fms-hf-tuning.git && \
cd fms-hf-tuning && \
python -m pip install -r requirements.txt && \
python -m pip install -r flashattn_requirements.txt && \
python -m pip install -U datasets && \
python -m pip install /tmp/fms-hf-tuning
python -m pip install ".[dev]" && \
python -m pip install ".[flash-attn]" && \
python -m pip install -U datasets

RUN mkdir -p /licenses
COPY LICENSE /licenses/
Expand All @@ -129,4 +125,4 @@ RUN useradd -u $USER_UID tuning -m -g 0 --system && \
WORKDIR /app
USER ${USER}

CMD [ "tail", "-f", "/dev/null" ]
CMD [ "tail", "-f", "/dev/null" ]
2 changes: 0 additions & 2 deletions flashattn_requirements.txt

This file was deleted.

34 changes: 34 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[build-system]
requires = [
"setuptools>=61",
"setuptools-scm>=8.0"]

[project]
name = "fms-hf-tuning"
version = "0.0.1"
description = "FMS HF Tuning"
authors = [
{name = "Sukriti Sharma", email = "sukriti.sharma4@ibm.com"},
{name = "Anh Uong", email = "anh.uong@ibm.com"},
]
license = {text = "Apache-2.0"}
readme = "README.md"
requires-python = "~=3.9"
keywords = ['fms-hf-tuning', 'python', 'tuning']
classifiers=[
"License :: OSI Approved :: Apache Software License"
]

dynamic = ["dependencies"]

[project.optional-dependencies]
dev = ["wheel", "packaging", "ninja"]
flash-attn = ["flash-attn"]

[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}

[project.urls]
Homepage = "https://github.com/foundation-model-stack/fms-hf-tuning"
Repository = "https://github.com/foundation-model-stack/fms-hf-tuning"
Issues = "https://github.com/foundation-model-stack/fms-hf-tuning/issues"
5 changes: 1 addition & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
numpy
accelerate>=0.20.3
packaging
transformers>=4.34.1
transformers
torch
aim==3.18.1
sentencepiece
tokenizers>=0.13.3
tqdm
trl
ninja
peft>=0.8.0
datasets>=2.15.0
fire

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
# Third Party
from setuptools import find_packages, setup

setup(name="tuning", version="0.0.1", packages=find_packages())
setup(name="fms-hf-tuning", version="0.0.1", packages=find_packages())

0 comments on commit 4cc09cb

Please sign in to comment.