Skip to content
Snippets Groups Projects
Commit 4496b975 authored by Łukasz Pszenny's avatar Łukasz Pszenny
Browse files

Variable name fix in download.py

dependency update
setting encoding to utf-8

Update dataset.py

Update setup.py

Update dataset.py
parent d7e52f93
Branches
Tags
1 merge request!44Switching to UD 2.9
Pipeline #5976 passed with stage
in 8 minutes and 26 seconds
......@@ -82,7 +82,7 @@ class UniversalDependenciesDatasetReader(allen_data.DatasetReader):
for conllu_file in file_path:
file = pathlib.Path(conllu_file)
assert conllu_file and file.exists(), f"File with path '{conllu_file}' does not exists!"
with file.open("r") as f:
with file.open("r", encoding="utf-8") as f:
for annotation in conllu.parse_incr(f, fields=self.fields, field_parsers=self.field_parsers):
yield self.text_to_instance(annotation)
......
......@@ -23,7 +23,7 @@ _CACHE_DIR = os.getenv("COMBO_DIR", os.path.join(_HOME_DIR, ".combo"))
def download_file(model_name, force=False):
_make_cache_dir()
data = model_name.split("-")[-1]
url = _URL.format(name=model_name, data=DATA_TO_PATH[data])
url = _URL.format(model=model_name, data=DATA_TO_PATH[data])
local_filename = url.split("/")[-1]
location = os.path.join(_CACHE_DIR, local_filename)
if os.path.exists(location) and not force:
......
......@@ -7,7 +7,7 @@ REQUIREMENTS = [
'conllu==2.3.2',
'dataclasses;python_version<"3.7"',
'jsonnet==0.15.0',
'filelock==3.0;python_version>="3.9"',
'filelock==3.0',
'numpy==1.22.0',
'overrides==3.1.0',
'requests==2.23.0',
......@@ -53,4 +53,4 @@ setup(
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
]
)
\ No newline at end of file
)
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment