Increase the default download latency from 5 mins to 1 hour since the download speed is throttled.
#8
by
xianbao
- opened
- wikipedia.py +7 -0
wikipedia.py
CHANGED
@@ -939,6 +939,13 @@ class Wikipedia(datasets.GeneratorBasedBuilder):
|
|
939 |
)
|
940 |
|
941 |
def _split_generators(self, dl_manager):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
942 |
def _base_url(lang):
|
943 |
return _BASE_URL_TMPL.format(lang=lang.replace("-", "_"), date=self.config.date)
|
944 |
|
|
|
939 |
)
|
940 |
|
941 |
def _split_generators(self, dl_manager):
|
942 |
+
storage_options = dl_manager.download_config.storage_options
|
943 |
+
|
944 |
+
# If timeout is not set, set it to 1 hour
|
945 |
+
if 'timeout' not in storage_options.get('client_kwargs', {}):
|
946 |
+
storage_options['client_kwargs'] = storage_options.get('client_kwargs', {}).copy()
|
947 |
+
storage_options['client_kwargs']['timeout'] = aiohttp.ClientTimeout(total=3600) # 1 hour timeout
|
948 |
+
|
949 |
def _base_url(lang):
|
950 |
return _BASE_URL_TMPL.format(lang=lang.replace("-", "_"), date=self.config.date)
|
951 |
|