Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
Speed up question answering tests (#775)
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanwharris authored Sep 20, 2021
1 parent 81c467c commit c2095d3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
10 changes: 5 additions & 5 deletions flash/text/question_answering/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ def from_squad(
num_workers: int = 0,
**preprocess_kwargs,
) -> QuestionAnsweringData:
"""Downloads and loads the XSum data set."""
download_data("https://rajpurkar.github.io/SQuAD-explorer/dataset/train-v2.0.json", "./data/")
download_data("https://rajpurkar.github.io/SQuAD-explorer/dataset/dev-v2.0.json", "./data/")
"""Downloads and loads a tiny subset of the squad V2 data set."""
download_data("https://pl-flash-data.s3.amazonaws.com/squad_tiny.zip", "./data/")

return QuestionAnsweringData.from_squad_v2(
train_file="./data/train-v2.0.json",
val_file="./data/dev-v2.0.json",
train_file="./data/squad_tiny/train.json",
val_file="./data/squad_tiny/val.json",
backbone=backbone,
batch_size=batch_size,
num_workers=num_workers,
Expand Down
7 changes: 3 additions & 4 deletions flash_examples/question_answering.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@
from flash.text import QuestionAnsweringData, QuestionAnsweringTask

# 1. Create the DataModule
download_data("https://rajpurkar.github.io/SQuAD-explorer/dataset/train-v2.0.json", "./data/")
download_data("https://rajpurkar.github.io/SQuAD-explorer/dataset/dev-v2.0.json", "./data/")
download_data("https://pl-flash-data.s3.amazonaws.com/squad_tiny.zip", "./data/")

datamodule = QuestionAnsweringData.from_squad_v2(
train_file="./data/train-v2.0.json",
val_file="./data/dev-v2.0.json",
train_file="./data/squad_tiny/train.json",
val_file="./data/squad_tiny/val.json",
)

# 2. Build the task
Expand Down

0 comments on commit c2095d3

Please sign in to comment.