Skip to content

Commit

Permalink
fix merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
dhosterman committed May 13, 2024
1 parent 6a52896 commit b4cd121
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions src/modelbench/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,19 @@
import json
import os
import pathlib
import pkgutil
import platform
import random
import re
import sys
from collections import defaultdict
from datetime import datetime, timezone
from multiprocessing import Pool
from typing import List, Mapping, Dict
from typing import Dict, List, Mapping

import casefy
import click
import termcolor
from click import echo
from modelbench.benchmarks import (
BenchmarkDefinition,
GeneralPurposeAiChatBenchmark,
)
from modelbench.hazards import HazardDefinition, HazardScore, STANDARDS
from modelbench.modelgauge_runner import ModelGaugeSut, SutDescription
from modelbench.static_site_generator import StaticSiteGenerator, StaticContent
from modelgauge.config import load_secrets_from_config, write_default_config
from modelgauge.instance_factory import FactoryEntry
from modelgauge.load_plugins import load_plugins
Expand All @@ -32,8 +25,14 @@
from modelgauge.test_registry import TESTS
from modelgauge.tests.safe import SafeTestResult
from retry import retry
import pkgutil, sys

from modelbench.benchmarks import (
BenchmarkDefinition,
GeneralPurposeAiChatBenchmark,
)
from modelbench.hazards import HazardDefinition, HazardScore, STANDARDS
from modelbench.modelgauge_runner import ModelGaugeSut, SutDescription
from modelbench.static_site_generator import StaticContent, StaticSiteGenerator

_DEFAULT_SUTS = ModelGaugeSut

Expand All @@ -56,6 +55,7 @@ def load_local_plugins(_, __, path: pathlib.Path):


@click.group()
@local_plugin_dir_option
def cli() -> None:
write_default_config()
load_plugins()
Expand Down Expand Up @@ -299,9 +299,8 @@ def some_convenient_tests():
"-s",
multiple=True,
)
def grid(output, max_instances: int, sut: List[str]) -> None:
@local_plugin_dir_option
def grid(output, max_instances: int) -> None:
def grid(output, max_instances: int, sut: List[str]) -> None:
if not output:
output = sys.stdout

Expand Down Expand Up @@ -339,9 +338,8 @@ def grid(output, max_instances: int) -> None:
"-s",
multiple=True,
)
def responses(output: pathlib.Path, max_instances: int, sut: List[str]) -> None:
@local_plugin_dir_option
def responses(output: pathlib.Path, max_instances: int) -> None:
def responses(output: pathlib.Path, max_instances: int, sut: List[str]) -> None:
def clean_text(str):
return re.sub(r"\s+", " ", str.replace("\n", " ")).strip()

Expand Down

0 comments on commit b4cd121

Please sign in to comment.