Commit 9907e0a7 authored by FarzanehNakhaee's avatar FarzanehNakhaee
Browse files

Merge branch 'big-refactor' into add-qa4mre-config

parents 649a7f95 070b6b9c
group:
- super-glue-t5-prompt
task: t5-prompt
reference: "From Raffel et. al. 2019"
task: super_glue-record-t5-prompt
dataset_path: super_glue
dataset_name: record
training_split: train
......
group:
- super-glue-lm-eval-v1
task: "wic"
dataset_path: super_glue
dataset_name: wic
output_type: multiple_choice
training_split: train
validation_split: validation
doc_to_text: !function utils.doc_to_text
doc_to_target: !function utils.doc_to_target
gold_alias: "{{label}}" # this will be cast to an int.
template_aliases: "{% set answer_choices = ['no', 'yes'] %}"
metric_list:
- metric: acc
group:
- super-glue-promptsource
task: "GPT-3-prompt"
dataset_path: super_glue
dataset_name: wic
training_split: train
validation_split: validation
use_prompt: "promptsource:GPT-3-prompt"
metric_list:
- metric: exact_match
aggregation: mean
higher_is_better: true
ignore_case: true
ignore_punctuation: true
include: promptsource-00.yaml
group:
- super-glue-promptsource
task: "GPT-3-prompt-with-label"
use_prompt: "promptsource:GPT-3-prompt-with-label"
include: promptsource-00.yaml
group:
- super-glue-promptsource
task: "affirmation_true_or_false"
use_prompt: "promptsource:affirmation_true_or_false"
def doc_to_text(doc):
return (
"Sentence 1: {}\nSentence 2: {}\nQuestion: Is the word '{}' used in the same way in the"
" two sentences above?\nAnswer:".format(
doc["sentence1"],
doc["sentence2"],
doc["sentence1"][doc["start1"] : doc["end1"]],
)
)
def doc_to_target(doc):
return " {}".format({0: "no", 1: "yes"}[doc["label"]])
group:
- super-glue-t5-prompt
task: t5-prompt
reference: "From Raffel et. al. 2019"
task: super_glue-wsc-t5-prompt
dataset_path: super_glue
dataset_name: wsc
training_split: train
......
......@@ -10,7 +10,7 @@ import collections
import importlib.util
import fnmatch
from typing import List, Union
from typing import List, Literal, Union
import gc
import torch
......@@ -453,7 +453,11 @@ def create_iterator(raw_iterator, rank, world_size, limit=None):
return islice(raw_iterator, rank, limit, world_size)
def pad_and_concat(max_length: int, tensors: List[torch.Tensor], padding_side="right"):
def pad_and_concat(
max_length: int,
tensors: List[torch.Tensor],
padding_side: Literal["right", "left"] = "right",
):
"""
Method for padding a list of tensors given the maximum tensor
length in the batch. Used for batching inputs and continuations in
......
......@@ -55,7 +55,7 @@ setuptools.setup(
"promptsource": [
"promptsource @ git+https://github.com/bigscience-workshop/promptsource.git#egg=promptsource"
],
"auto-gptq": ["auto-gptq[triton] @ git+https://github.com/PanQiWei/AutoGPTQ"],
"gptq": ["auto-gptq[triton] @ git+https://github.com/PanQiWei/AutoGPTQ"],
"anthropic": ["anthropic"],
},
)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment