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

ValueError: unknown url type: '/root/.underthesea/models/parsers/vi-dp-v1a0' #687

Open
qhungbui7 opened this issue Jun 13, 2023 · 0 comments

Comments

@qhungbui7
Copy link

qhungbui7 commented Jun 13, 2023

Following the instruction from https://github.com/undertheseanlp/underthesea/blob/main/contribute/CONTRIBUTING.rst, I start to test my fork locally for my another issue but this bug emerges when I run python setup.py test. It seems that I have not downloaded the model for some tests so the script try to download it from torch.hub but the URL input seems weird when it is the folder directory in my computer, thus I think the script tries to download the model from my computer.

The full error log:

running test
WARNING: Testing via this command is deprecated and will be removed in a future version. Users looking for a generic test entry point independent of test runner are encouraged to use tox.
running egg_info
writing underthesea.egg-info/PKG-INFO
writing dependency_links to underthesea.egg-info/dependency_links.txt
writing entry points to underthesea.egg-info/entry_points.txt
writing requirements to underthesea.egg-info/requires.txt
writing top-level names to underthesea.egg-info/top_level.txt
reading manifest template 'MANIFEST.in'
warning: no files found matching 'AUTHORS.rst'
warning: no files found matching 'README.rst'
warning: no previously-included files matching '__pycache__' found under directory '*'
warning: no previously-included files matching '*.py[co]' found under directory '*'
warning: no files found matching '*.jpg' under directory 'docs'
warning: no files found matching '*.png' under directory 'docs'
warning: no files found matching '*.gif' under directory 'docs'
adding license file 'LICENSE'
writing manifest file 'underthesea.egg-info/SOURCES.txt'
running build_ext
Downloading: "/root/.underthesea/models/parsers/vi-dp-v1a0" to /root/.cache/torch/hub/checkpoints/vi-dp-v1a0
Traceback (most recent call last):
  File "/kaggle/working/underthesea/setup.py", line 44, in <module>
    setup(
  File "/opt/conda/lib/python3.10/site-packages/setuptools/__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
  File "/opt/conda/lib/python3.10/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/opt/conda/lib/python3.10/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/opt/conda/lib/python3.10/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/opt/conda/lib/python3.10/site-packages/setuptools/command/test.py", line 223, in run
    self.run_tests()
  File "/opt/conda/lib/python3.10/site-packages/setuptools/command/test.py", line 226, in run_tests
    test = unittest.main(
  File "/opt/conda/lib/python3.10/unittest/main.py", line 100, in __init__
    self.parseArgs(argv)
  File "/opt/conda/lib/python3.10/unittest/main.py", line 147, in parseArgs
    self.createTests()
  File "/opt/conda/lib/python3.10/unittest/main.py", line 158, in createTests
    self.test = self.testLoader.loadTestsFromNames(self.testNames,
  File "/opt/conda/lib/python3.10/unittest/loader.py", line 220, in loadTestsFromNames
    suites = [self.loadTestsFromName(name, module) for name in names]
  File "/opt/conda/lib/python3.10/unittest/loader.py", line 220, in <listcomp>
    suites = [self.loadTestsFromName(name, module) for name in names]
  File "/opt/conda/lib/python3.10/unittest/loader.py", line 191, in loadTestsFromName
    return self.loadTestsFromModule(obj)
  File "/opt/conda/lib/python3.10/site-packages/setuptools/command/test.py", line 56, in loadTestsFromModule
    tests.append(self.loadTestsFromName(submodule))
  File "/opt/conda/lib/python3.10/unittest/loader.py", line 191, in loadTestsFromName
    return self.loadTestsFromModule(obj)
  File "/opt/conda/lib/python3.10/site-packages/setuptools/command/test.py", line 56, in loadTestsFromModule
    tests.append(self.loadTestsFromName(submodule))
  File "/opt/conda/lib/python3.10/unittest/loader.py", line 154, in loadTestsFromName
    module = __import__(module_name)
  File "/kaggle/working/underthesea/tests/lab/dp_predict.py", line 6, in <module>
    parser = DependencyParser.load(join(MODELS_FOLDER, 'parsers', 'vi-dp-v1a0'))
  File "/kaggle/working/underthesea/underthesea/models/dependency_parser.py", line 303, in load
    state = torch.hub.load_state_dict_from_url(path)
  File "/opt/conda/lib/python3.10/site-packages/torch/hub.py", line 746, in load_state_dict_from_url
    download_url_to_file(url, cached_file, hash_prefix, progress=progress)
  File "/opt/conda/lib/python3.10/site-packages/torch/hub.py", line 610, in download_url_to_file
    req = Request(url, headers={"User-Agent": "torch.hub"})
  File "/opt/conda/lib/python3.10/urllib/request.py", line 322, in __init__
    self.full_url = url
  File "/opt/conda/lib/python3.10/urllib/request.py", line 348, in full_url
    self._parse()
  File "/opt/conda/lib/python3.10/urllib/request.py", line 377, in _parse
    raise ValueError("unknown url type: %r" % self.full_url)
ValueError: unknown url type: '/root/.underthesea/models/parsers/vi-dp-v1a0'
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