Skip to content

Commit

Permalink
Merge pull request #14 from for-ai/add/rewardbench-full
Browse files Browse the repository at this point in the history
Add rewardbench-full
  • Loading branch information
ShayekhBinIslam authored Aug 3, 2024
2 parents 008b533 + 1e91635 commit f329aa1
Show file tree
Hide file tree
Showing 67 changed files with 11,552 additions and 0 deletions.
6 changes: 6 additions & 0 deletions rewardbench-full/.flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[flake8]
exclude =
rewardbench/models/openassistant.py
per-file-ignores =
rewardbench/generative.py:E501
extend-ignore = E203
30 changes: 30 additions & 0 deletions rewardbench-full/.github/workflows/quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Quality

on:
push:
branches:
- main
- v*-release
pull_request:
branches:
- main

jobs:

check_code_quality:
name: Check code quality
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Python environment
uses: actions/setup-python@v2
with:
python-version: 3.10.10
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .
- name: Code quality
run: |
make quality
31 changes: 31 additions & 0 deletions rewardbench-full/.github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Tests

on:
push:
branches:
- main
- v*-release
pull_request:
branches:
- main

jobs:

unit-tests:
name: Run unit tests
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Python environment
uses: actions/setup-python@v2
with:
python-version: 3.10.10
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .
- name: Run unit tests
run: HF_TOKEN=$HF_TOKEN pytest tests/
178 changes: 178 additions & 0 deletions rewardbench-full/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
# Ignore IDE and editor files
.idea/
.vscode/
*.sublime-project
*.sublime-workspace

# Ignore system files
.DS_Store
Thumbs.db

# model outputs/files
results/

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# generated beaker configs
beaker_configs/auto_created

# image / plot outputs
*.png
*.pdf

# generated local directory
hf_snapshot_evals/
data/
output/
45 changes: 45 additions & 0 deletions rewardbench-full/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# This dockerfile is forked from ai2/cuda11.8-cudnn8-dev-ubuntu20.04
# To get the latest id, run `beaker image pull ai2/cuda11.8-cudnn8-dev-ubuntu20.04`
# and then `docker image list`, to verify docker image is pulled
# e.g. `Image is up to date for gcr.io/ai2-beaker-core/public/cncl3kcetc4q9nvqumrg:latest`
FROM gcr.io/ai2-beaker-core/public/cq29hmn3sck728v1o7d0:latest

RUN apt update && apt install -y openjdk-8-jre-headless

RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
RUN apt-get -y install git-lfs

WORKDIR /stage/

RUN pip install --upgrade pip setuptools wheel
RUN pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

COPY rewardbench rewardbench
COPY scripts scripts
COPY setup.py setup.py
COPY Makefile Makefile
COPY README.md README.md
RUN pip install -e .
RUN chmod +x scripts/*

# this is just very slow
RUN pip install flash-attn==2.5.0 --no-build-isolation

# for olmo-instruct v1, weird install requirements
RUN pip install ai2-olmo

# for better-pairRM
RUN pip install jinja2

# generative installs
RUN pip install anthropic
RUN pip install openai
RUN pip install together
RUN pip install google-generativeai

# updated for Gemma 2
RUN pip install vllm==0.5.1
# from git+https://github.com/vllm-project/vllm.git@d87f39e9a9dd149f5dd7a58b4d98b21f713827b6

# for interactive session
RUN chmod -R 777 /stage/
Loading

0 comments on commit f329aa1

Please sign in to comment.