Skip to content

Commit

Permalink
pytest runs for reward instructor module
Browse files Browse the repository at this point in the history
  • Loading branch information
bethanyconnolly committed Mar 1, 2023
1 parent c51ce3a commit 7bb03c8
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 7 deletions.
29 changes: 29 additions & 0 deletions model/reward/instructor/pyproject.toml
@@ -0,0 +1,29 @@
[build-system]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"

[project]
name = "reward_instructor"
description = "Open Assistant Reward Instructor Module"
version = "1.0.0"
authors = [
{ name = "LAION-AI", email = "contact@laion.ai" }
]

dependencies = [
"datasets==2.8.0",
"evaluate==0.4.0",
"scikit-learn==1.2.0",
"sentencepiece==0.1.97",
"torch>=1.12.1",
"transformers==4.25.1",
"wandb==0.13.7",
"pandas==1.3", # downgrade to prevent errors with version `GLIBCXX_3.4.29' not found
]

[tool.setuptools]
py-modules = []

[tool.black]
line-length = 120
target-version = ['py310']
7 changes: 0 additions & 7 deletions model/reward/instructor/requirements.txt

This file was deleted.

6 changes: 6 additions & 0 deletions model/reward/instructor/tests/test_dataset.py
@@ -1,9 +1,11 @@
import pytest
from experimental_dataset import DataCollatorForSummaryScore, HFSummaryQuality
from rank_datasets import AnthropicRLHF, DataCollatorForPairRank, GPTJSynthetic, HFSummary, WebGPT
from torch.utils.data import DataLoader
from transformers import AutoTokenizer


@pytest.mark.skip(reason="needs work")
def test_hfsummary():

tokenizer = AutoTokenizer.from_pretrained("bigscience/mt0-large")
Expand All @@ -15,6 +17,7 @@ def test_hfsummary():
batch["input_ids"].shape


@pytest.mark.skip(reason="needs work")
def test_webgpt():

tokenizer = AutoTokenizer.from_pretrained("bigscience/mt0-large")
Expand All @@ -25,6 +28,7 @@ def test_webgpt():
print(batch["input_ids"].shape)


@pytest.mark.skip(reason="needs work")
def test_anthropic_rlhf():

tokenizer = AutoTokenizer.from_pretrained("bigscience/mt0-large")
Expand All @@ -35,6 +39,7 @@ def test_anthropic_rlhf():
print(batch["input_ids"].shape)


@pytest.mark.skip(reason="needs work")
def test_hf_summary_quality():

tokenizer = AutoTokenizer.from_pretrained("bigscience/mt0-large")
Expand All @@ -45,6 +50,7 @@ def test_hf_summary_quality():
print(batch["input_ids"].shape)


@pytest.mark.skip(reason="needs work")
def test_gptj_dataset():
dataset = GPTJSynthetic()
tokenizer = AutoTokenizer.from_pretrained("bigscience/mt0-large")
Expand Down

0 comments on commit 7bb03c8

Please sign in to comment.