Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
epinzur committed Jun 25, 2024
1 parent 87bd47c commit 0a706ff
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
10 changes: 7 additions & 3 deletions ragulate/cli_commands/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ def setup_query(subparsers):
query_parser.add_argument(
"--subset",
type=str,
help=("The subset of the dataset to query", "Only valid when a single dataset is passed."),
help=(
"The subset of the dataset to query",
"Only valid when a single dataset is passed.",
),
action="append",
)
query_parser.set_defaults(func=lambda args: call_query(**vars(args)))
Expand All @@ -74,12 +77,13 @@ def call_query(
**kwargs,
):


datasets = [find_dataset(name=name) for name in dataset]

if len(subset) > 0:
if len(datasets) > 1:
raise ValueError("Only can set `subset` param when there is one dataset")
raise ValueError(
"Only can set `subset` param when there is one dataset"
)
else:
datasets[0].subsets = subset

Expand Down
9 changes: 5 additions & 4 deletions ragulate/datasets/base_dataset.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import bz2
import tempfile
from abc import ABC, abstractmethod
from os import path, makedirs
from os import makedirs, path
from pathlib import Path
from typing import Dict, List, Optional, Tuple

import aiohttp
import aiofiles
import bz2
import tempfile
import aiohttp
from tqdm.asyncio import tqdm


class BaseDataset(ABC):

root_storage_path: str
Expand Down
2 changes: 1 addition & 1 deletion ragulate/datasets/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from typing import List
import os
from typing import List

from .base_dataset import BaseDataset
from .crag_dataset import CragDataset
Expand Down

0 comments on commit 0a706ff

Please sign in to comment.