From 0a706ffe93d7cccda2dc1cef244675662d306498 Mon Sep 17 00:00:00 2001 From: Eric Pinzur Date: Tue, 25 Jun 2024 14:15:20 +0200 Subject: [PATCH] fmt --- ragulate/cli_commands/query.py | 10 +++++++--- ragulate/datasets/base_dataset.py | 9 +++++---- ragulate/datasets/utils.py | 2 +- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/ragulate/cli_commands/query.py b/ragulate/cli_commands/query.py index bbbfbc3..cf7e0d2 100644 --- a/ragulate/cli_commands/query.py +++ b/ragulate/cli_commands/query.py @@ -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))) @@ -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 diff --git a/ragulate/datasets/base_dataset.py b/ragulate/datasets/base_dataset.py index e11cb9d..aba5694 100644 --- a/ragulate/datasets/base_dataset.py +++ b/ragulate/datasets/base_dataset.py @@ -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 diff --git a/ragulate/datasets/utils.py b/ragulate/datasets/utils.py index ad28e6f..60766d0 100644 --- a/ragulate/datasets/utils.py +++ b/ragulate/datasets/utils.py @@ -1,5 +1,5 @@ -from typing import List import os +from typing import List from .base_dataset import BaseDataset from .crag_dataset import CragDataset