Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/1.11.0/metrics/rouge/rouge.py
COLLABORATOR
Hi,

Did you try to run the code multiple times (GitHub URLs can be down sometimes for various reasons)? I can access `https://raw.githubusercontent.com/huggingface/datasets/1.11.0/metrics/rouge/rouge.py`, so this code is working without an error on my side. 

Additionally, can you please run the `datasets-cli env` command because it seems to me that you are using the `datasets` version different from `1.12.1`?
2021-10-22T10:39:50Z
https://github.com/huggingface/datasets/issues/3134#issuecomment-949503035
https://api.github.com/repos/huggingface/datasets/issues/3134
IC_kwDODunzps44mEQ7
https://api.github.com/repos/huggingface/datasets/issues/comments/949503035/reactions
2021-10-22T10:39:50Z
https://api.github.com/repos/huggingface/datasets/issues/comments/949503035
https://avatars.githubusercontent.com/u/47462742?v=4
https://api.github.com/users/mariosasko/events{/privacy}
https://api.github.com/users/mariosasko/followers
https://api.github.com/users/mariosasko/following{/other_user}
https://api.github.com/users/mariosasko/gists{/gist_id}
https://github.com/mariosasko
mariosasko
MDQ6VXNlcjQ3NDYyNzQy
https://api.github.com/users/mariosasko/orgs
https://api.github.com/users/mariosasko/received_events
https://api.github.com/users/mariosasko/repos
https://api.github.com/users/mariosasko/starred{/owner}{/repo}
https://api.github.com/users/mariosasko/subscriptions
User
https://api.github.com/users/mariosasko
public
NONE
Same issue when running `metric = datasets.load_metric("accuracy")`.
Error info is:
```
metric = datasets.load_metric("accuracy")
Traceback (most recent call last):

  File "<ipython-input-2-d25db38b26c5>", line 1, in <module>
    metric = datasets.load_metric("accuracy")

  File "D:\anaconda3\lib\site-packages\datasets\load.py", line 610, in load_metric
    module_path, _ = prepare_module(

  File "D:\anaconda3\lib\site-packages\datasets\load.py", line 330, in prepare_module
    local_path = cached_path(file_path, download_config=download_config)

  File "D:\anaconda3\lib\site-packages\datasets\utils\file_utils.py", line 288, in cached_path
    output_path = get_from_cache(

  File "D:\anaconda3\lib\site-packages\datasets\utils\file_utils.py", line 605, in get_from_cache
    raise ConnectionError("Couldn't reach {}".format(url))
ConnectionError: Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/1.11.0/metrics/accuracy/accuracy.py
```


 My `datasets-cli env` result is as follows:
- `datasets` version: 1.11.0
- Platform: Windows-10-10.0.19041-SP0
- Python version: 3.8.8
- PyArrow version: 6.0.0

@yananchen1989 did you find a way to solve this?
2021-11-01T10:31:52Z
https://github.com/huggingface/datasets/issues/3134#issuecomment-956117735
https://api.github.com/repos/huggingface/datasets/issues/3134
IC_kwDODunzps44_TLn
https://api.github.com/repos/huggingface/datasets/issues/comments/956117735/reactions
2021-11-01T10:34:53Z
https://api.github.com/repos/huggingface/datasets/issues/comments/956117735
https://avatars.githubusercontent.com/u/30617291?v=4
https://api.github.com/users/CharlieUnderwood/events{/privacy}
https://api.github.com/users/CharlieUnderwood/followers
https://api.github.com/users/CharlieUnderwood/following{/other_user}
https://api.github.com/users/CharlieUnderwood/gists{/gist_id}
https://github.com/CharlieUnderwood
CharlieUnderwood
MDQ6VXNlcjMwNjE3Mjkx
https://api.github.com/users/CharlieUnderwood/orgs
https://api.github.com/users/CharlieUnderwood/received_events
https://api.github.com/users/CharlieUnderwood/repos
https://api.github.com/users/CharlieUnderwood/starred{/owner}{/repo}
https://api.github.com/users/CharlieUnderwood/subscriptions
User
https://api.github.com/users/CharlieUnderwood
public
NONE
It seems to be able to solve this issue by adding the equivalent `accuracy.py` locally. 
change `metric = datasets.load_metric("accuracy")` to  `metric = datasets.load_metric(path = "./accuracy.py")`.
Copy `accuracy.py` from browser at [accuracy.py](https://raw.githubusercontent.com/huggingface/datasets/1.11.0/metrics/accuracy/accuracy.py)
2021-11-01T11:17:49Z
https://github.com/huggingface/datasets/issues/3134#issuecomment-956146837
https://api.github.com/repos/huggingface/datasets/issues/3134
IC_kwDODunzps44_aSV
https://api.github.com/repos/huggingface/datasets/issues/comments/956146837/reactions
2021-11-01T11:17:49Z
https://api.github.com/repos/huggingface/datasets/issues/comments/956146837
https://avatars.githubusercontent.com/u/30617291?v=4
https://api.github.com/users/CharlieUnderwood/events{/privacy}
https://api.github.com/users/CharlieUnderwood/followers
https://api.github.com/users/CharlieUnderwood/following{/other_user}
https://api.github.com/users/CharlieUnderwood/gists{/gist_id}
https://github.com/CharlieUnderwood
CharlieUnderwood
MDQ6VXNlcjMwNjE3Mjkx
https://api.github.com/users/CharlieUnderwood/orgs
https://api.github.com/users/CharlieUnderwood/received_events
https://api.github.com/users/CharlieUnderwood/repos
https://api.github.com/users/CharlieUnderwood/starred{/owner}{/repo}
https://api.github.com/users/CharlieUnderwood/subscriptions
User
https://api.github.com/users/CharlieUnderwood
public
NONE
> It seems to be able to solve this issue by adding the equivalent `accuracy.py` locally. change `metric = datasets.load_metric("accuracy")` to `metric = datasets.load_metric(path = "./accuracy.py")`. Copy `accuracy.py` from browser at [accuracy.py](https://raw.githubusercontent.com/huggingface/datasets/1.11.0/metrics/accuracy/accuracy.py)

This is really a good way
2023-09-14T01:19:45Z
https://github.com/huggingface/datasets/issues/3134#issuecomment-1718520975
https://api.github.com/repos/huggingface/datasets/issues/3134
IC_kwDODunzps5mboyP
https://api.github.com/repos/huggingface/datasets/issues/comments/1718520975/reactions
2023-09-14T01:19:45Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1718520975
https://avatars.githubusercontent.com/u/138678006?v=4
https://api.github.com/users/qiuganbin123/events{/privacy}
https://api.github.com/users/qiuganbin123/followers
https://api.github.com/users/qiuganbin123/following{/other_user}
https://api.github.com/users/qiuganbin123/gists{/gist_id}
https://github.com/qiuganbin123
qiuganbin123
U_kgDOCEQO9g
https://api.github.com/users/qiuganbin123/orgs
https://api.github.com/users/qiuganbin123/received_events
https://api.github.com/users/qiuganbin123/repos
https://api.github.com/users/qiuganbin123/starred{/owner}{/repo}
https://api.github.com/users/qiuganbin123/subscriptions
User
https://api.github.com/users/qiuganbin123
public
datasets version: 1.12.1

`metric = datasets.load_metric('rouge')`

The error:

> ConnectionError                           Traceback (most recent call last)
> <ipython-input-3-dd10a0c5212f> in <module>
> ----> 1 metric = datasets.load_metric('rouge')
> 
> /usr/local/lib/python3.6/dist-packages/datasets/load.py in load_metric(path, config_name, process_id, num_process, cache_dir, experiment_id, keep_in_memory, download_config, download_mode, script_version, **metric_init_kwargs)
>     613         download_config=download_config,
>     614         download_mode=download_mode,
> --> 615         dataset=False,
>     616     )
>     617     metric_cls = import_main_class(module_path, dataset=False)
> 
> /usr/local/lib/python3.6/dist-packages/datasets/load.py in prepare_module(path, script_version, download_config, download_mode, dataset, force_local_path, dynamic_modules_path, return_resolved_file_path, **download_kwargs)
>     328                 file_path = hf_github_url(path=path, name=name, dataset=dataset, version=script_version)
>     329                 try:
> --> 330                     local_path = cached_path(file_path, download_config=download_config)
>     331                 except FileNotFoundError:
>     332                     if script_version is not None:
> 
> /usr/local/lib/python3.6/dist-packages/datasets/utils/file_utils.py in cached_path(url_or_filename, download_config, **download_kwargs)
>     296             use_etag=download_config.use_etag,
>     297             max_retries=download_config.max_retries,
> --> 298             use_auth_token=download_config.use_auth_token,
>     299         )
>     300     elif os.path.exists(url_or_filename):
> 
> /usr/local/lib/python3.6/dist-packages/datasets/utils/file_utils.py in get_from_cache(url, cache_dir, force_download, proxies, etag_timeout, resume_download, user_agent, local_files_only, use_etag, max_retries, use_auth_token)
>     603             raise FileNotFoundError("Couldn't find file at {}".format(url))
>     604         _raise_if_offline_mode_is_enabled(f"Tried to reach {url}")
> --> 605         raise ConnectionError("Couldn't reach {}".format(url))
>     606
>     607     # Try a second time
> 
> ConnectionError: Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/1.11.0/metrics/rouge/rouge.py


Is there any remedy to solve the connection issue ?