id int64 0 190k | prompt stringlengths 21 13.4M | docstring stringlengths 1 12k ⌀ |
|---|---|---|
16,297 | from abc import ABC, abstractmethod
from dataclasses import dataclass, field, replace
from typing import List, Optional, Tuple
import os
from pathlib import PurePath
import inspect
from helm.common.media_object import MultimediaObject
from helm.common.object_spec import ObjectSpec, create_object
from helm.common.genera... | Unpack the value from the tag. |
16,298 | import os
import json
import string
import random
from tqdm import tqdm
from typing import List, Dict, Optional
from helm.common.general import ensure_file_downloaded
from .scenario import Scenario, Instance, Input, Reference, Output, TEST_SPLIT
def load_csv(filename):
results = {}
with open(filename) as f:
... | null |
16,299 | import os
import json
import string
import random
from tqdm import tqdm
from typing import List, Dict, Optional
from helm.common.general import ensure_file_downloaded
from .scenario import Scenario, Instance, Input, Reference, Output, TEST_SPLIT
def load_json(filename):
with open(filename, "rb") as handler:
... | null |
16,300 | import os
import json
import string
import random
from tqdm import tqdm
from typing import List, Dict, Optional
from helm.common.general import ensure_file_downloaded
from .scenario import Scenario, Instance, Input, Reference, Output, TEST_SPLIT
def get_privacy_understanding_messages(
topic, question_prompt, perso... | null |
16,301 | import os
import json
import string
import random
from tqdm import tqdm
from typing import List, Dict, Optional
from helm.common.general import ensure_file_downloaded
from .scenario import Scenario, Instance, Input, Reference, Output, TEST_SPLIT
def load_json(filename):
with open(filename, "rb") as handler:
... | null |
16,302 | import json
import os
from typing import List
from helm.common.general import ensure_file_downloaded, ensure_directory_exists
from helm.common.hierarchical_logger import hlog
from .scenario import (
Scenario,
Instance,
Reference,
TRAIN_SPLIT,
VALID_SPLIT,
TEST_SPLIT,
CORRECT_TAG,
Input,
... | null |
16,303 | import re
from helm.common.optional_dependencies import handle_module_not_found_error
The provided code snippet includes necessary dependencies for implementing the `convert_html_to_text` function. Write a Python function `def convert_html_to_text(handler: HTML2Text, html: str) -> str` to solve the following problem:
... | Convert HTML to text Args: handler (HTML2Text): The HTML2Text handler html (str): The HTML to convert Returns: str: The text |
16,304 | from typing import Optional, Tuple, List, Dict, Any
import io
import os
import re
from helm.common.optional_dependencies import handle_module_not_found_error, OptionalDependencyNotInstalled
The provided code snippet includes necessary dependencies for implementing the `strip_unnecessary_latex_parts` function. Write a ... | Strip unnecessary parts of the LaTeX code. |
16,305 | from typing import Dict, List, Any
from helm.benchmark.scenarios.scenario import VALID_SPLIT
from helm.benchmark.scenarios.vision_language.image2structure.image2structure_scenario import (
Image2StructureScenario,
PROCESSED,
)
from helm.benchmark.scenarios.vision_language.image2structure.webpage.jekyll_server i... | null |
16,306 | from typing import Dict, List, Any
from helm.benchmark.scenarios.scenario import VALID_SPLIT
from helm.benchmark.scenarios.vision_language.image2structure.image2structure_scenario import (
Image2StructureScenario,
PROCESSED,
)
from helm.benchmark.scenarios.vision_language.image2structure.webpage.jekyll_server i... | null |
16,307 | from typing import Dict, List, Any
from helm.benchmark.scenarios.scenario import VALID_SPLIT
from helm.benchmark.scenarios.vision_language.image2structure.image2structure_scenario import (
Image2StructureScenario,
PROCESSED,
)
from helm.benchmark.scenarios.vision_language.image2structure.webpage.jekyll_server i... | null |
16,308 | import codecs
import getopt
import os
import shutil
import sys
import tempfile
from typing import IO
def run(fd_in, fd_out, config):
while True:
line = fd_in.readline()
if not line:
break
line = line.rstrip("\r\n")
# Find indentation style used in file if not set
... | null |
16,309 | import random
import dataclasses
from copy import copy
from typing import List, Dict, Literal, Tuple
from dataclasses import dataclass
from .scenario import Scenario, Instance, Reference, TRAIN_SPLIT, VALID_SPLIT, TEST_SPLIT, CORRECT_TAG, Input, Output
The provided code snippet includes necessary dependencies for impl... | All potential subjects for the facts and rules for sythetic_reasoning_natural as well as their categories. Subjects is a dictionary of subject categories like "person" and "animal" which correspond to a list of potential subjects. Attributes corresponds to an initial list of attributes which are only synonymous with th... |
16,310 | import random
import dataclasses
from copy import copy
from typing import List, Dict, Literal, Tuple
from dataclasses import dataclass
from .scenario import Scenario, Instance, Reference, TRAIN_SPLIT, VALID_SPLIT, TEST_SPLIT, CORRECT_TAG, Input, Output
class LanguageRule(LanguageLogicalStatement):
"""Class describi... | Generates a random set of rules about a subject as dictionaries, given a list of potential attributes and the category (e.g. person) of the subject (e.g. Alice) These rules are guaranteed to not contradict one another, and attributes implied by a single rule will not imply any attributes in any other rules (i.e. there ... |
16,311 | import random
import dataclasses
from copy import copy
from typing import List, Dict, Literal, Tuple
from dataclasses import dataclass
from .scenario import Scenario, Instance, Reference, TRAIN_SPLIT, VALID_SPLIT, TEST_SPLIT, CORRECT_TAG, Input, Output
class LanguageRule(LanguageLogicalStatement):
"""Class describi... | Generates a test case given a set of rules, i.e. a statement about the subject from which something can be potentially deduced given the rules. We include an argument, p_consequenceless, to re-roll with some probability if the generated fact does not allow anything to be determined. |
16,312 | from helm.benchmark.adaptation.request_state import RequestState
from helm.benchmark.metrics.evaluate_instances_metric import EvaluateInstancesMetric
from .metric_name import MetricName
from .statistic import Stat
from typing import List
import re
PRIVACY_UNDERSTANDING_LEAK_KEYWORD = [
"Yes",
"Hey Mike",
"O... | null |
16,313 | import json
import pandas
import numpy as np
import os
import pickle
import spacy
import spacy.cli
from typing import List, Dict, Optional
from collections import defaultdict
from helm.benchmark.adaptation.scenario_state import ScenarioState
from helm.benchmark.adaptation.request_state import RequestState
from helm.ben... | Computes paired bootstrap test for the Hypothesis: treament > control Args: treatment: list of float, representing results of treament (better model results) control: list of float, representing results of control (worse model results) nboot: int, number of bootstraps to perform |
16,314 | import json
import os
from typing import Callable, Dict, List, Optional
import numpy as np
from helm.common.general import ensure_file_downloaded
from helm.common.optional_dependencies import handle_module_not_found_error
from helm.common.request import RequestResult, Sequence
from helm.benchmark.adaptation.request_sta... | Self-BLEU. Average over all scores, where each score is the BLEU of one generation compared against all other generations. If there is fewer than one completion, the self-bleu score is 0. |
16,315 | import json
import os
from typing import Callable, Dict, List, Optional
import numpy as np
from helm.common.general import ensure_file_downloaded
from helm.common.optional_dependencies import handle_module_not_found_error
from helm.common.request import RequestResult, Sequence
from helm.benchmark.adaptation.request_sta... | Monte Carlo estimate of model entropy in nats. |
16,316 | import json
import os
from typing import Callable, Dict, List, Optional
import numpy as np
from helm.common.general import ensure_file_downloaded
from helm.common.optional_dependencies import handle_module_not_found_error
from helm.common.request import RequestResult, Sequence
from helm.benchmark.adaptation.request_sta... | Reads the file with the human evaluation results for the narrative wedging scenario, finds the annotations for the instance currently being evaluated, and outputs the human evaluation metrics for that instance. |
16,317 | import json
import os
from typing import Callable, Dict, List, Optional
import numpy as np
from helm.common.general import ensure_file_downloaded
from helm.common.optional_dependencies import handle_module_not_found_error
from helm.common.request import RequestResult, Sequence
from helm.benchmark.adaptation.request_sta... | Reads the file with the human evaluation results for the narrative reiteration scenario, finds the annotations for the thesis currently being evaluated, and outputs the human evaluation metrics for that thesis. |
16,318 | from collections import defaultdict
import math
from dataclasses import dataclass
from typing import List, Dict, Set
from urllib.parse import unquote
import numpy as np
import scipy
import calibration as cal
from helm.benchmark.adaptation.scenario_state import ScenarioState
from helm.benchmark.metrics.evaluate_referenc... | Convert tokens to strings. This function is especially useful when tokens include byte tokens. Example: ["<|endoftext|>", "bytes:\\xe2\\x80", "bytes:\\x99", "Hello", " world", "bytes:\\xe2\\x80", "bytes:\\x99", "<|endoftext|>"] => ["<|endoftext|>", "’", "Hello", " world", "’", "<|endoftext|>"] The function is adapted f... |
16,319 | from collections import defaultdict
import math
from dataclasses import dataclass
from typing import List, Dict, Set
from urllib.parse import unquote
import numpy as np
import scipy
import calibration as cal
from helm.benchmark.adaptation.scenario_state import ScenarioState
from helm.benchmark.metrics.evaluate_referenc... | null |
16,320 | from collections import defaultdict
import math
from dataclasses import dataclass
from typing import List, Dict, Set
from urllib.parse import unquote
import numpy as np
import scipy
import calibration as cal
from helm.benchmark.adaptation.scenario_state import ScenarioState
from helm.benchmark.metrics.evaluate_referenc... | Compute metrics that are common to both `evaluate_generation` and `evaluate_references`. |
16,321 | from collections import defaultdict
import math
from dataclasses import dataclass
from typing import List, Dict, Set
from urllib.parse import unquote
import numpy as np
import scipy
import calibration as cal
from helm.benchmark.adaptation.scenario_state import ScenarioState
from helm.benchmark.metrics.evaluate_referenc... | Compute the logprob and normalization factors for the first completion |
16,322 | from collections import defaultdict
import math
from dataclasses import dataclass
from typing import List, Dict, Set
from urllib.parse import unquote
import numpy as np
import scipy
import calibration as cal
from helm.benchmark.adaptation.scenario_state import ScenarioState
from helm.benchmark.metrics.evaluate_referenc... | null |
16,323 | from typing import Dict, List, Optional
import json
import importlib_resources as resources
from helm.common.hierarchical_logger import hlog
from helm.benchmark.adaptation.request_state import RequestState
from helm.benchmark.adaptation.adapter_spec import AdapterSpec
from helm.benchmark.window_services.window_service ... | null |
16,324 | from helm.benchmark.metrics.metric_service import MetricService
from helm.common.perspective_api_request import PerspectiveAPIRequestResult, PerspectiveAPIRequest, ToxicityAttributes
def compute_toxicity_score(text: str, metric_service: MetricService) -> float:
"""
Compute the toxicity score of a given text usi... | Returns True, if the prompt is considered toxic, False otherwise. |
16,325 | from dataclasses import replace
from typing import Callable, Dict, List, Optional, Set, Tuple, cast
import numpy as np
from functools import partial
from helm.benchmark.adaptation.adapter_spec import AdapterSpec
from helm.benchmark.adaptation.request_state import RequestState
from helm.benchmark.metrics.cleva_metrics_h... | Setup: - Gold (correct references): G1 ... Gm - Predictions (completions): P1 ... Pk For each pair (G, P), we can define a ${score} (e.g., exact match, F1, BLEU). We define the following stats: - ${score}: max_i score(Gi, P1) - ${score}@k: max_{i,j} score(Gi, Pj) |
16,326 | import re
from typing import List, Optional
import numpy as np
from nltk.tokenize.treebank import TreebankWordTokenizer
from helm.benchmark.adaptation.request_state import RequestState
from helm.benchmark.adaptation.adapter_spec import AdapterSpec
from helm.benchmark.scenarios.scenario import Reference
from helm.common... | Compute the length of the longest common prefix. |
16,327 | import re
from typing import List, Optional
import numpy as np
from nltk.tokenize.treebank import TreebankWordTokenizer
from helm.benchmark.adaptation.request_state import RequestState
from helm.benchmark.adaptation.adapter_spec import AdapterSpec
from helm.benchmark.scenarios.scenario import Reference
from helm.common... | Compute the edit similarity between two lists of strings. Edit similarity is also used in the paper Lee, Katherine, et al. "Deduplicating training data makes language models better." arXiv preprint arXiv:2107.06499 (2021). |
16,328 | import re
from typing import List, Optional
import numpy as np
from nltk.tokenize.treebank import TreebankWordTokenizer
from helm.benchmark.adaptation.request_state import RequestState
from helm.benchmark.adaptation.adapter_spec import AdapterSpec
from helm.benchmark.scenarios.scenario import Reference
from helm.common... | Remove blank lines and tabs. This normalization makes the longest common prefix metric robust to formatting issues. Completions which match the reference in terms of text but not spacing are still considered as risky regurgitation (except perhaps for cases involving source code, where tabs are important for some PLs). |
16,329 | import numpy as np
from helm.common.optional_dependencies import handle_module_not_found_error
The provided code snippet includes necessary dependencies for implementing the `preprocess_image` function. Write a Python function `def preprocess_image(image: Image) -> np.ndarray` to solve the following problem:
Preproces... | Preprocesses an image for use in metrics. Returns a grayscale image stored using int in a numpy array. Also normalizes the exposure of the image. |
16,330 | import numpy as np
from helm.common.optional_dependencies import handle_module_not_found_error
The provided code snippet includes necessary dependencies for implementing the `pixel_similarity` function. Write a Python function `def pixel_similarity(img_a: np.ndarray, img_b: np.ndarray, threshold: float = 0.5, toleranc... | Measure the pixel-level similarity between two images If the image has a color that occurs more than 100 * threshold percent of the time, Then the associated pixels are ignored and the match is computed only on the other pixels. A tolerance is used to compare each pixels to allow some small variations in color. The tol... |
16,331 | import numpy as np
from helm.common.optional_dependencies import handle_module_not_found_error
try:
import cv2
from PIL.Image import Image
except ModuleNotFoundError as e:
handle_module_not_found_error(e, suggestions=["image2structure"])
The provided code snippet includes necessary dependencies for impleme... | Use ORB features to measure image similarity between two numpy arrays representing images. Args: img_a (np.ndarray): the first image img_b (np.ndarray): the second image Returns: float: the ORB similarity between the images |
16,332 | from typing import List, Tuple
from tqdm import tqdm
import numpy as np
import math
from helm.common.optional_dependencies import handle_module_not_found_error
try:
import cv2
from PIL import Image
except ModuleNotFoundError as e:
handle_module_not_found_error(e, suggestions=["images"])
def get_most_frequen... | Compute the Earth Mover's Distance between two images using a recursive approach. Both images are discretized into patches, and the EMD is computed on the patches. This is done by computing a cost matrix C such that C[i, j] is the cost of moving the patch i of img1 to the patch j of img2. Moving a patch to another patc... |
16,333 | from typing import List, Dict, Optional, Callable, Tuple, Any, Set
from dataclasses import dataclass
from torchvision import transforms, models
from skimage.metrics import structural_similarity as ssim
from nltk.tokenize.treebank import TreebankWordTokenizer
import torch
import warnings
import numpy as np
from helm.ben... | Pad the axis of the small image to match the size of the large image. |
16,334 | import numpy as np
from helm.common.optional_dependencies import handle_module_not_found_error
def handle_module_not_found_error(e: ModuleNotFoundError, suggestions: Optional[List[str]] = None):
# TODO: Ask user to install more specific optional dependencies
# e.g. crfm-helm[plots] or crfm-helm[server]
sug... | Compute the fractal coefficient of an image. From https://en.wikipedia.org/wiki/Minkowski–Bouligand_dimension, in fractal geometry, the Minkowski–Bouligand dimension, also known as Minkowski dimension or box-counting dimension, is a way of determining the fractal dimension of a set S in a Euclidean space Rn, or more ge... |
16,335 | import contextlib
import gc
from enum import Enum
import faulthandler
import io
from io import StringIO
import json
import multiprocessing
import os
import platform
import signal
import sys
import tempfile
from typing import List, Union, Dict, Optional
from unittest.mock import patch, mock_open
import numpy as np
from ... | null |
16,336 | import threading
import multiprocessing
from typing import List, Union, Sequence, cast
from helm.common.hierarchical_logger import hlog
from helm.common.request import RequestResult
from helm.benchmark.adaptation.scenario_state import ScenarioState
from helm.benchmark.adaptation.request_state import RequestState
from h... | Convert boolean scores to int. |
16,337 | import threading
import multiprocessing
from typing import List, Union, Sequence, cast
from helm.common.hierarchical_logger import hlog
from helm.common.request import RequestResult
from helm.benchmark.adaptation.scenario_state import ScenarioState
from helm.benchmark.adaptation.request_state import RequestState
from h... | Compute the average number of tests passed. |
16,338 | import threading
import multiprocessing
from typing import List, Union, Sequence, cast
from helm.common.hierarchical_logger import hlog
from helm.common.request import RequestResult
from helm.benchmark.adaptation.scenario_state import ScenarioState
from helm.benchmark.adaptation.request_state import RequestState
from h... | Return 1.0 if all tests passed; otherwise return 0.0. |
16,339 | import threading
import multiprocessing
from typing import List, Union, Sequence, cast
from helm.common.hierarchical_logger import hlog
from helm.common.request import RequestResult
from helm.benchmark.adaptation.scenario_state import ScenarioState
from helm.benchmark.adaptation.request_state import RequestState
from h... | null |
16,340 | from abc import ABC, abstractmethod
from dataclasses import dataclass, replace
from collections import defaultdict
from typing import List, Dict, Tuple, Optional, Iterable
from helm.common.object_spec import ObjectSpec, create_object
from helm.common.general import singleton, parallel_map
from helm.benchmark.augmentati... | For each instance, we compute the worst case perfomance between each perturbation and the non-perturbed input (perturbation=None). This allows us to reason about the invariances of a model as opposed to just looking at its performance on perturbed inputs. We also compute the worst case performance across all robustness... |
16,341 | from abc import ABC, abstractmethod
from dataclasses import dataclass, replace
from collections import defaultdict
from typing import List, Dict, Tuple, Optional, Iterable
from helm.common.object_spec import ObjectSpec, create_object
from helm.common.general import singleton, parallel_map
from helm.benchmark.augmentati... | null |
16,342 | from abc import ABC, abstractmethod
from dataclasses import dataclass, replace
from collections import defaultdict
from typing import List, Dict, Tuple, Optional, Iterable
from helm.common.object_spec import ObjectSpec, create_object
from helm.common.general import singleton, parallel_map
from helm.benchmark.augmentati... | Populate the fields of the Stat with the context info (e.g., split, perturbation) from the instance. |
16,343 | import numpy as np
import tqdm
import os
import time
def any_gpu_with_space(gb_needed):
os.system("nvidia-smi -q -d Memory |grep -A4 GPU|grep Free >tmp_smi")
memory_available = [float(x.split()[2]) / 1024.0 for i, x in enumerate(open("tmp_smi", "r").readlines())]
os.remove("tmp_smi")
return any([mem >= ... | null |
16,344 | import numpy as np
import tqdm
import os
import time
def get_freer_gpu():
def select_freer_gpu():
freer_gpu = str(get_freer_gpu())
print("Will use GPU: %s" % (freer_gpu))
os.environ["CUDA_LAUNCH_BLOCKING"] = "1"
os.environ["CUDA_VISIBLE_DEVICES"] = "" + freer_gpu
return freer_gpu | null |
16,345 | import numpy as np
import tqdm
import os
import time
def batcher(iterator, batch_size=4, progress=False):
if progress:
iterator = tqdm.tqdm(iterator)
batch = []
for elem in iterator:
batch.append(elem)
if len(batch) == batch_size:
final_batch = batch
batch =... | null |
16,346 | from typing import Dict, List
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import nltk
import numpy as np
import numpy.typing as npt
import torch
import os
import json
from . import utils_misc
model_map = {
"snli-base": {"model_card": "boychaboy/SNLI_roberta-base", "entailment_idx": 0,... | null |
16,347 | from typing import Dict, List
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import nltk
import numpy as np
import numpy.typing as npt
import torch
import os
import json
from . import utils_misc
model_map = {
"snli-base": {"model_card": "boychaboy/SNLI_roberta-base", "entailment_idx": 0,... | null |
16,348 | from typing import Dict, List
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import nltk
import numpy as np
import numpy.typing as npt
import torch
import os
import json
from . import utils_misc
def get_neutral_idx(ent_idx, con_idx):
return list(set([0, 1, 2]) - set([ent_idx, con_idx]))... | null |
16,349 | import itertools
from typing import Any, Dict, List, Optional
from helm.benchmark.metrics.metric import MetricSpec
class MetricSpec(ObjectSpec):
"""Specifies how to create a `Metric`."""
pass
def get_summarization_critique_metric_specs(num_respondents: int) -> List[MetricSpec]:
return [
MetricSpe... | null |
16,350 | from typing import Dict, Optional, List
from dataclasses import dataclass
import cattrs
import yaml
from helm.common.hierarchical_logger import hlog
from helm.common.object_spec import ObjectSpec
class TokenizerConfig:
"""Configuration for a tokenizer."""
name: str
"""Name of the tokenizer."""
tokenizer... | null |
16,351 | import argparse
from dataclasses import replace
import os
from typing import List, Optional
from helm.benchmark.presentation.run_entry import RunEntry, read_run_entries
from helm.common.cache_backend_config import MongoCacheBackendConfig, SqliteCacheBackendConfig
from helm.common.general import ensure_directory_exists
... | Runs RunSpecs given a list of RunSpec descriptions. |
16,352 | import argparse
from dataclasses import replace
import os
from typing import List, Optional
from helm.benchmark.presentation.run_entry import RunEntry, read_run_entries
from helm.common.cache_backend_config import MongoCacheBackendConfig, SqliteCacheBackendConfig
from helm.common.general import ensure_directory_exists
... | Runs RunSpecs given a list of RunSpec descriptions. |
16,353 | import argparse
from dataclasses import replace
import os
from typing import List, Optional
from helm.benchmark.presentation.run_entry import RunEntry, read_run_entries
from helm.common.cache_backend_config import MongoCacheBackendConfig, SqliteCacheBackendConfig
from helm.common.general import ensure_directory_exists
... | null |
16,354 | import argparse
from dataclasses import replace
import os
from typing import List, Optional
from helm.benchmark.presentation.run_entry import RunEntry, read_run_entries
from helm.common.cache_backend_config import MongoCacheBackendConfig, SqliteCacheBackendConfig
from helm.common.general import ensure_directory_exists
... | null |
16,355 | from typing import Dict, Optional, List
from dataclasses import dataclass, field
from datetime import date
import dacite
import yaml
MODEL_NAME_TO_MODEL_METADATA: Dict[str, ModelMetadata] = {model.name: model for model in ALL_MODELS_METADATA}
The provided code snippet includes necessary dependencies for implementing t... | Return all model names. |
16,356 | from typing import Dict, Optional, List
from dataclasses import dataclass, field
from datetime import date
import dacite
import yaml
TEXT_MODEL_TAG: str = "TEXT_MODEL_TAG"
def get_model_names_with_tag(tag: str) -> List[str]:
"""Return all model names of models with the given tag."""
return [model.name for model... | Return all model names of text models. |
16,357 | from typing import Dict, Optional, List
from dataclasses import dataclass, field
from datetime import date
import dacite
import yaml
CODE_MODEL_TAG: str = "CODE_MODEL_TAG"
def get_model_names_with_tag(tag: str) -> List[str]:
"""Return all model names of models with the given tag."""
return [model.name for model... | Return all model names of code models. |
16,358 | from typing import Dict, Optional, List
from dataclasses import dataclass, field
from datetime import date
import dacite
import yaml
INSTRUCTION_FOLLOWING_MODEL_TAG: str = "INSTRUCTION_FOLLOWING_MODEL_TAG"
def get_model_names_with_tag(tag: str) -> List[str]:
"""Return all model names of models with the given tag.""... | Return all model names of instruction following models. |
16,359 | from typing import Dict, Optional, List
from dataclasses import dataclass, field
from datetime import date
import dacite
import yaml
TEXT_TO_IMAGE_MODEL_TAG: str = "TEXT_TO_IMAGE_MODEL_TAG"
def model_has_tag(model_name: str, tag: str) -> bool:
"""Return True if the model has the given tag. False otherwise."""
r... | Returns True if the model is a text-to-image model. False otherwise. |
16,360 | from typing import Dict, Optional, List
from dataclasses import dataclass, field
from datetime import date
import dacite
import yaml
VISION_LANGUAGE_MODEL_TAG: str = "VISION_LANGUAGE_MODEL_TAG"
def model_has_tag(model_name: str, tag: str) -> bool:
"""Return True if the model has the given tag. False otherwise."""
... | Returns True if the model is a vision-language model (VLM). False otherwise. |
16,361 | import dacite
import json
import math
import os
import traceback
import typing
from collections import Counter
import dataclasses
from typing import Any, Dict, List
import numpy as np
from tqdm import tqdm
from helm.benchmark.adaptation.request_state import RequestState
from helm.common.general import ensure_directory_... | Get the cached models pat within the benchmark output path. |
16,362 | import dacite
import json
import math
import os
import traceback
import typing
from collections import Counter
import dataclasses
from typing import Any, Dict, List
import numpy as np
from tqdm import tqdm
from helm.benchmark.adaptation.request_state import RequestState
from helm.common.general import ensure_directory_... | Set the benchmark output path. |
16,363 | import dacite
import json
import math
import os
import traceback
import typing
from collections import Counter
import dataclasses
from typing import Any, Dict, List
import numpy as np
from tqdm import tqdm
from helm.benchmark.adaptation.request_state import RequestState
from helm.common.general import ensure_directory_... | Return a new list of PerInstanceStats with stats with NaNs removed. Python's stdlib json.dumps() will produce invalid JSON when serializing a NaN. See: - https://github.com/stanford-crfm/helm/issues/1765 - https://bugs.python.org/issue40633 - https://docs.python.org/3/library/json.html#infinite-and-nan-number-values |
16,364 | import dacite
import json
import math
import os
import traceback
import typing
from collections import Counter
import dataclasses
from typing import Any, Dict, List
import numpy as np
from tqdm import tqdm
from helm.benchmark.adaptation.request_state import RequestState
from helm.common.general import ensure_directory_... | Get the instances necessary for this run: Train instances (split=train): keep all (if any) for in-context learning Eval instances (split=valid or test): keep at most `max_eval_instances` specified in `AdapterSpec` by sampling Return the resulting train and eval instances. |
16,365 | from typing import List
from helm.benchmark.adaptation.common_adapter_specs import get_instruct_adapter_spec
from helm.benchmark.metrics.metric import MetricSpec
from helm.benchmark.run_spec import RunSpec, run_spec_function
from helm.benchmark.scenarios.scenario import ScenarioSpec
def get_instruction_following_critiq... | null |
16,366 | from typing import List
from helm.benchmark.adaptation.common_adapter_specs import get_instruct_adapter_spec
from helm.benchmark.metrics.metric import MetricSpec
from helm.benchmark.run_spec import RunSpec, run_spec_function
from helm.benchmark.scenarios.scenario import ScenarioSpec
def get_instruction_following_critiq... | null |
16,367 | from typing import List
from helm.benchmark.adaptation.common_adapter_specs import get_instruct_adapter_spec
from helm.benchmark.metrics.metric import MetricSpec
from helm.benchmark.run_spec import RunSpec, run_spec_function
from helm.benchmark.scenarios.scenario import ScenarioSpec
def get_instruction_following_critiq... | null |
16,368 | from typing import List
from helm.benchmark.adaptation.common_adapter_specs import get_instruct_adapter_spec
from helm.benchmark.metrics.metric import MetricSpec
from helm.benchmark.run_spec import RunSpec, run_spec_function
from helm.benchmark.scenarios.scenario import ScenarioSpec
def get_instruction_following_critiq... | null |
16,369 | from typing import List
from helm.benchmark.adaptation.common_adapter_specs import get_instruct_adapter_spec
from helm.benchmark.metrics.metric import MetricSpec
from helm.benchmark.run_spec import RunSpec, run_spec_function
from helm.benchmark.scenarios.scenario import ScenarioSpec
def get_instruction_following_critiq... | null |
16,370 | from typing import List
from helm.benchmark.adaptation.common_adapter_specs import get_instruct_adapter_spec
from helm.benchmark.metrics.metric import MetricSpec
from helm.benchmark.run_spec import RunSpec, run_spec_function
from helm.benchmark.scenarios.scenario import ScenarioSpec
def get_instruction_following_critiq... | null |
16,371 | from helm.benchmark.adaptation.adapter_spec import (
ADAPT_GENERATION,
ADAPT_MULTIPLE_CHOICE_JOINT,
AdapterSpec,
)
from helm.benchmark.adaptation.common_adapter_specs import (
get_generation_adapter_spec,
get_machine_translation_adapter_spec,
get_multiple_choice_adapter_spec,
)
from helm.benchma... | null |
16,372 | from helm.benchmark.adaptation.adapter_spec import (
ADAPT_GENERATION,
ADAPT_MULTIPLE_CHOICE_JOINT,
AdapterSpec,
)
from helm.benchmark.adaptation.common_adapter_specs import (
get_generation_adapter_spec,
get_machine_translation_adapter_spec,
get_multiple_choice_adapter_spec,
)
from helm.benchma... | null |
16,373 | from helm.benchmark.adaptation.adapter_spec import (
ADAPT_GENERATION,
ADAPT_MULTIPLE_CHOICE_JOINT,
AdapterSpec,
)
from helm.benchmark.adaptation.common_adapter_specs import (
get_generation_adapter_spec,
get_machine_translation_adapter_spec,
get_multiple_choice_adapter_spec,
)
from helm.benchma... | null |
16,374 | from helm.benchmark.adaptation.adapter_spec import (
ADAPT_GENERATION,
ADAPT_MULTIPLE_CHOICE_JOINT,
AdapterSpec,
)
from helm.benchmark.adaptation.common_adapter_specs import (
get_generation_adapter_spec,
get_machine_translation_adapter_spec,
get_multiple_choice_adapter_spec,
)
from helm.benchma... | null |
16,375 | from helm.benchmark.adaptation.adapter_spec import (
ADAPT_GENERATION,
ADAPT_MULTIPLE_CHOICE_JOINT,
AdapterSpec,
)
from helm.benchmark.adaptation.common_adapter_specs import (
get_generation_adapter_spec,
get_machine_translation_adapter_spec,
get_multiple_choice_adapter_spec,
)
from helm.benchma... | null |
16,376 | from helm.benchmark.adaptation.adapter_spec import (
ADAPT_GENERATION,
ADAPT_MULTIPLE_CHOICE_JOINT,
AdapterSpec,
)
from helm.benchmark.adaptation.common_adapter_specs import (
get_generation_adapter_spec,
get_machine_translation_adapter_spec,
get_multiple_choice_adapter_spec,
)
from helm.benchma... | null |
16,377 | from helm.benchmark.adaptation.adapter_spec import (
ADAPT_GENERATION,
ADAPT_MULTIPLE_CHOICE_JOINT,
AdapterSpec,
)
from helm.benchmark.adaptation.common_adapter_specs import (
get_generation_adapter_spec,
get_machine_translation_adapter_spec,
get_multiple_choice_adapter_spec,
)
from helm.benchma... | null |
16,378 | from helm.benchmark.adaptation.adapter_spec import (
ADAPT_GENERATION,
ADAPT_MULTIPLE_CHOICE_JOINT,
AdapterSpec,
)
from helm.benchmark.adaptation.common_adapter_specs import (
get_generation_adapter_spec,
get_machine_translation_adapter_spec,
get_multiple_choice_adapter_spec,
)
from helm.benchma... | null |
16,379 | from helm.benchmark.adaptation.adapter_spec import (
ADAPT_GENERATION,
ADAPT_MULTIPLE_CHOICE_JOINT,
AdapterSpec,
)
from helm.benchmark.adaptation.common_adapter_specs import (
get_generation_adapter_spec,
get_machine_translation_adapter_spec,
get_multiple_choice_adapter_spec,
)
from helm.benchma... | null |
16,380 | from typing import List, Optional
from helm.benchmark.adaptation.adapter_spec import AdapterSpec
from helm.benchmark.adaptation.adapters.adapter_factory import ADAPT_GENERATION
from helm.benchmark.metrics.metric import MetricSpec
from helm.benchmark.run_spec import RunSpec, run_spec_function
from helm.benchmark.run_spe... | null |
16,381 | from typing import List, Optional
from helm.benchmark.adaptation.adapter_spec import AdapterSpec
from helm.benchmark.adaptation.adapters.adapter_factory import ADAPT_GENERATION
from helm.benchmark.metrics.metric import MetricSpec
from helm.benchmark.run_spec import RunSpec, run_spec_function
from helm.benchmark.run_spe... | null |
16,382 | from typing import List, Optional
from helm.benchmark.adaptation.adapter_spec import AdapterSpec
from helm.benchmark.adaptation.adapters.adapter_factory import ADAPT_GENERATION
from helm.benchmark.metrics.metric import MetricSpec
from helm.benchmark.run_spec import RunSpec, run_spec_function
from helm.benchmark.run_spe... | null |
16,383 | from typing import List, Optional
from helm.benchmark.adaptation.adapter_spec import AdapterSpec
from helm.benchmark.adaptation.adapters.adapter_factory import ADAPT_GENERATION
from helm.benchmark.metrics.metric import MetricSpec
from helm.benchmark.run_spec import RunSpec, run_spec_function
from helm.benchmark.run_spe... | null |
16,384 | from typing import List, Optional
from helm.benchmark.adaptation.adapter_spec import AdapterSpec
from helm.benchmark.adaptation.adapters.adapter_factory import ADAPT_GENERATION
from helm.benchmark.metrics.metric import MetricSpec
from helm.benchmark.run_spec import RunSpec, run_spec_function
from helm.benchmark.run_spe... | null |
16,385 | from typing import List, Optional
from helm.benchmark.adaptation.adapter_spec import AdapterSpec
from helm.benchmark.adaptation.adapters.adapter_factory import ADAPT_GENERATION
from helm.benchmark.metrics.metric import MetricSpec
from helm.benchmark.run_spec import RunSpec, run_spec_function
from helm.benchmark.run_spe... | null |
16,386 | from typing import List, Optional
from helm.benchmark.adaptation.adapter_spec import AdapterSpec
from helm.benchmark.adaptation.adapters.adapter_factory import ADAPT_GENERATION
from helm.benchmark.metrics.metric import MetricSpec
from helm.benchmark.run_spec import RunSpec, run_spec_function
from helm.benchmark.run_spe... | null |
16,387 | from typing import List, Optional
from helm.benchmark.adaptation.adapter_spec import AdapterSpec
from helm.benchmark.adaptation.adapters.adapter_factory import ADAPT_GENERATION
from helm.benchmark.metrics.metric import MetricSpec
from helm.benchmark.run_spec import RunSpec, run_spec_function
from helm.benchmark.run_spe... | null |
16,388 | from typing import List, Optional
from helm.benchmark.adaptation.adapter_spec import AdapterSpec
from helm.benchmark.adaptation.adapters.adapter_factory import ADAPT_GENERATION
from helm.benchmark.metrics.metric import MetricSpec
from helm.benchmark.run_spec import RunSpec, run_spec_function
from helm.benchmark.run_spe... | null |
16,389 | from typing import List, Optional
from helm.benchmark.adaptation.adapter_spec import AdapterSpec
from helm.benchmark.adaptation.adapters.adapter_factory import ADAPT_GENERATION
from helm.benchmark.metrics.metric import MetricSpec
from helm.benchmark.run_spec import RunSpec, run_spec_function
from helm.benchmark.run_spe... | null |
16,390 | from typing import List, Optional
from helm.benchmark.adaptation.adapter_spec import AdapterSpec
from helm.benchmark.adaptation.adapters.adapter_factory import ADAPT_GENERATION
from helm.benchmark.metrics.metric import MetricSpec
from helm.benchmark.run_spec import RunSpec, run_spec_function
from helm.benchmark.run_spe... | null |
16,391 | from typing import List, Optional
from helm.benchmark.adaptation.adapter_spec import AdapterSpec
from helm.benchmark.adaptation.adapters.adapter_factory import ADAPT_GENERATION
from helm.benchmark.metrics.metric import MetricSpec
from helm.benchmark.run_spec import RunSpec, run_spec_function
from helm.benchmark.run_spe... | null |
16,392 | from typing import List, Optional
from helm.benchmark.adaptation.adapter_spec import AdapterSpec
from helm.benchmark.adaptation.adapters.adapter_factory import ADAPT_GENERATION
from helm.benchmark.metrics.metric import MetricSpec
from helm.benchmark.run_spec import RunSpec, run_spec_function
from helm.benchmark.run_spe... | null |
16,393 | from typing import List, Optional
from helm.benchmark.adaptation.adapter_spec import AdapterSpec
from helm.benchmark.adaptation.adapters.adapter_factory import ADAPT_GENERATION
from helm.benchmark.metrics.metric import MetricSpec
from helm.benchmark.run_spec import RunSpec, run_spec_function
from helm.benchmark.run_spe... | null |
16,394 | from typing import List, Optional
from helm.benchmark.adaptation.adapter_spec import AdapterSpec
from helm.benchmark.adaptation.adapters.adapter_factory import ADAPT_GENERATION
from helm.benchmark.metrics.metric import MetricSpec
from helm.benchmark.run_spec import RunSpec, run_spec_function
from helm.benchmark.run_spe... | null |
16,395 | from typing import List, Optional
from helm.benchmark.adaptation.adapter_spec import AdapterSpec
from helm.benchmark.adaptation.adapters.adapter_factory import ADAPT_GENERATION
from helm.benchmark.metrics.metric import MetricSpec
from helm.benchmark.run_spec import RunSpec, run_spec_function
from helm.benchmark.run_spe... | null |
16,396 | from typing import List, Optional
from helm.benchmark.adaptation.adapter_spec import AdapterSpec
from helm.benchmark.adaptation.adapters.adapter_factory import ADAPT_GENERATION
from helm.benchmark.metrics.metric import MetricSpec
from helm.benchmark.run_spec import RunSpec, run_spec_function
from helm.benchmark.run_spe... | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.