Skip to content

Commit

Permalink
LIT: Move TyDI data into examples/tydi
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 642676042
  • Loading branch information
RyanMullins authored and LIT team committed Jun 12, 2024
1 parent 2475b3b commit a59641c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
File renamed without changes.
11 changes: 5 additions & 6 deletions lit_nlp/examples/tydi/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@

from absl import app
from absl import flags

from lit_nlp import dev_server
from lit_nlp import server_flags
from lit_nlp.components import word_replacer
from lit_nlp.examples.datasets import question_answering
from lit_nlp.examples.tydi import model
from lit_nlp.examples.tydi import data as tydi_data
from lit_nlp.examples.tydi import model as tydi_model

# NOTE: additional flags defined in server_flags.py
_FLAGS = flags.FLAGS
Expand Down Expand Up @@ -55,10 +54,10 @@ def main(argv: Sequence[str]) -> Optional[dev_server.LitServerType]:
# Ignore path prefix, if using /path/to/<model_name> to load from a
# specific directory rather than the default shortcut.
model_name = os.path.basename(model_name_or_path)
models[model_name] = model.TyDiModel(model_name=model_name_or_path)
models[model_name] = tydi_model.TyDiModel(model_name=model_name_or_path)

max_examples: int = _MAX_EXAMPLES.value
dataset_defs: tuple[tuple[str, str]] = (
dataset_defs: tuple[tuple[str, str], ...] = (
("TyDiQA-Multilingual", "validation"),
("TyDiQA-English", "validation-en"),
("TyDiQA-Finnish", "validation-fi"),
Expand All @@ -71,7 +70,7 @@ def main(argv: Sequence[str]) -> Optional[dev_server.LitServerType]:
("TyDiQA-Telugu", "validation-te"),
)
datasets = {
name: question_answering.TyDiQA(split=split, max_examples=max_examples)
name: tydi_data.TyDiQA(split=split, max_examples=max_examples)
for name, split in dataset_defs
}

Expand Down

0 comments on commit a59641c

Please sign in to comment.