Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fsspec.exceptions.FSTimeoutError #1986

Open
Allan1358 opened this issue Dec 25, 2024 · 0 comments
Open

fsspec.exceptions.FSTimeoutError #1986

Allan1358 opened this issue Dec 25, 2024 · 0 comments

Comments

@Allan1358
Copy link

Description
Hello, I encountered a timeout problem when using dspy to import the HotPotQA data set. How can I solve it? As a beginner, I look forward to the answer.Thank you very much.

Complete Code
import cognify
from cognify.hub.evaluators import f1_score_str

@cognify.register_evaluator
def answer_f1(answer: str, ground_truth: str):
return f1_score_str(answer, ground_truth)

def formatting(item):
return (
{'question': item.question},
{'ground_truth': item.answer}
)

@cognify.register_data_loader
def load_data_minor():
from dspy.datasets.hotpotqa import HotPotQA
dataset = HotPotQA(train_seed=1, train_size=150, eval_seed=2023, dev_size=200, test_size=0,)

trainset = [formatting(x) for x in dataset.train[0:100]]
valset = [formatting(x) for x in dataset.train[100:150]]
devset = [formatting(x) for x in dataset.dev]
return trainset, valset, devset

from cognify.hub.search import default
search_settings = default.create_search(
evaluator_batch_size=50,
)
Error Output
Downloading data: 61%|██████████████████████████████████████▎ | 345M/566M [04:59<04:10, 885kB/s]Traceback (most recent call last):
File "C:\Users\ZYX.conda\envs\Python3.11-env\Lib\site-packages\aiohttp\streams.py", line 347, in _wait
await waiter
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users\ZYX.conda\envs\Python3.11-env\Lib\site-packages\fsspec\asyn.py", line 56, in _runner
result[0] = await coro
^^^^^^^^^^
File "C:\Users\ZYX.conda\envs\Python3.11-env\Lib\site-packages\fsspec\implementations\http.py", line 262, in _get_file chunk = await r.content.read(chunk_size)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ZYX.conda\envs\Python3.11-env\Lib\site-packages\aiohttp\streams.py", line 428, in read
await self._wait("read")
File "C:\Users\ZYX.conda\envs\Python3.11-env\Lib\site-packages\aiohttp\streams.py", line 346, in _wait
with self._timer:
File "C:\Users\ZYX.conda\envs\Python3.11-env\Lib\site-packages\aiohttp\helpers.py", line 671, in exit
raise asyncio.TimeoutError from exc_val
TimeoutError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "", line 198, in run_module_as_main
File "", line 88, in run_code
File "C:\Users\ZYX.conda\envs\Python3.11-env\Scripts\cognify.exe_main
.py", line 7, in
File "E:\AILalala\cognify\cognify_main
.py", line 110, in main
optimize_routine(cognify_args)
File "E:\AILalala\cognify\cognify_main_.py", line 55, in optimize_routine
(train_set, val_set, test_set), control_param = parse_pipeline_config_file(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\AILalala\cognify\cognify_main_.py", line 44, in parse_pipeline_config_file
train_set, val_set, test_set = data_loader_fn()
^^^^^^^^^^^^^^^^
File "E:\AILalala\cognify\examples\HotPotQA\config.py", line 17, in load_data_minor
dataset = HotPotQA(train_seed=1, train_size=150, eval_seed=2023, dev_size=200, test_size=0,)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ZYX.conda\envs\Python3.11-env\Lib\site-packages\dspy\datasets\hotpotqa.py", line 23, in init
hf_official_train = load_dataset("hotpot_qa", "fullwiki", split="train", trust_remote_code=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ZYX.conda\envs\Python3.11-env\Lib\site-packages\datasets\load.py", line 2151, in load_dataset
builder_instance.download_and_prepare(
File "C:\Users\ZYX.conda\envs\Python3.11-env\Lib\site-packages\datasets\builder.py", line 924, in download_and_prepare self._download_and_prepare(
File "C:\Users\ZYX.conda\envs\Python3.11-env\Lib\site-packages\datasets\builder.py", line 1648, in _download_and_prepare
super()._download_and_prepare(
File "C:\Users\ZYX.conda\envs\Python3.11-env\Lib\site-packages\datasets\builder.py", line 978, in _download_and_prepare
split_generators = self._split_generators(dl_manager, **split_generators_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ZYX.cache\huggingface\modules\datasets_modules\datasets\hotpot_qa\133b9501f892e5193babbad937bee3b4899deb4691ef4d791e6ac0111c875bb5\hotpot_qa.py", line 116, in _split_generators
files = dl_manager.download(paths)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ZYX.conda\envs\Python3.11-env\Lib\site-packages\datasets\download\download_manager.py", line 159, in download
downloaded_path_or_paths = map_nested(
^^^^^^^^^^^
File "C:\Users\ZYX.conda\envs\Python3.11-env\Lib\site-packages\datasets\utils\py_utils.py", line 511, in map_nested
mapped = [
^
File "C:\Users\ZYX.conda\envs\Python3.11-env\Lib\site-packages\datasets\utils\py_utils.py", line 512, in
_single_map_nested((function, obj, batched, batch_size, types, None, True, None))
File "C:\Users\ZYX.conda\envs\Python3.11-env\Lib\site-packages\datasets\utils\py_utils.py", line 380, in _single_map_nested
return [mapped_item for batch in iter_batched(data_struct, batch_size) for mapped_item in function(batch)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ZYX.conda\envs\Python3.11-env\Lib\site-packages\datasets\utils\py_utils.py", line 380, in
return [mapped_item for batch in iter_batched(data_struct, batch_size) for mapped_item in function(batch)]
^^^^^^^^^^^^^^^
File "C:\Users\ZYX.conda\envs\Python3.11-env\Lib\site-packages\datasets\download\download_manager.py", line 219, in _download_batched
return [
^
File "C:\Users\ZYX.conda\envs\Python3.11-env\Lib\site-packages\datasets\download\download_manager.py", line 220, in
self._download_single(url_or_filename, download_config=download_config)
File "C:\Users\ZYX.conda\envs\Python3.11-env\Lib\site-packages\datasets\download\download_manager.py", line 229, in _download_single
out = cached_path(url_or_filename, download_config=download_config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ZYX.conda\envs\Python3.11-env\Lib\site-packages\datasets\utils\file_utils.py", line 205, in cached_path output_path = get_from_cache(
^^^^^^^^^^^^^^^
File "C:\Users\ZYX.conda\envs\Python3.11-env\Lib\site-packages\datasets\utils\file_utils.py", line 411, in get_from_cache
fsspec_get(url, temp_file, storage_options=storage_options, desc=download_desc, disable_tqdm=disable_tqdm)
File "C:\Users\ZYX.conda\envs\Python3.11-env\Lib\site-packages\datasets\utils\file_utils.py", line 330, in fsspec_get
fs.get_file(path, temp_file.name, callback=callback)
File "C:\Users\ZYX.conda\envs\Python3.11-env\Lib\site-packages\fsspec\asyn.py", line 118, in wrapper
return sync(self.loop, func, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ZYX.conda\envs\Python3.11-env\Lib\site-packages\fsspec\asyn.py", line 101, in sync
raise FSTimeoutError from return_result
fsspec.exceptions.FSTimeoutError
Downloading data: 61%|█████████████████████████████████████▊ | 345M/566M [05:00<03:12, 1.15MB/s]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant