Skip to content

Regression with 0.8.0 and Windows #313

@davidmezzetti

Description

@davidmezzetti

Hello, hope all is well!

I ran into the following error with TxtAI's GitHub build on Windows:

  File "D:\a\txtai\txtai\test\python\testvectors\testdense\testm2v.py", line 24, in setUpClass
    cls.model = VectorsFactory.create({"path": "minishlab/potion-base-8M"}, None)
  File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\txtai\vectors\dense\factory.py", line 52, in create
    return Model2Vec(config, scoring, models)
  File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\txtai\vectors\dense\m2v.py", line 57, in __init__
    super().__init__(config, scoring, models)
  File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\txtai\vectors\base.py", line 45, in __init__
    self.model = self.load(config.get("path"))
  File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\txtai\vectors\base.py", line 101, in load
    model = self.loadmodel(path)
  File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\txtai\vectors\dense\m2v.py", line 60, in loadmodel
    return StaticModel.from_pretrained(path)
  File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\model2vec\model.py", line 211, in from_pretrained
    return _loading_helper(
  File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\model2vec\model.py", line 543, in _loading_helper
    embeddings, tokenizer, config, metadata, weights, mapping = load_pretrained(
  File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\model2vec\persistence\persistence.py", line 104, in load_pretrained
    folder = _resolve_folder(folder_or_repo_path=folder_or_repo_path, token=token, force_download=force_download)
  File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\model2vec\persistence\persistence.py", line 147, in _resolve_folder
    folder = Path(huggingface_hub.snapshot_download(str(folder_or_repo_path), repo_type="model", token=token))
  File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\huggingface_hub\utils\_validators.py", line 106, in _inner_fn
    validate_repo_id(arg_value)
  File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\huggingface_hub\utils\_validators.py", line 160, in validate_repo_id
    raise HFValidationError(
huggingface_hub.errors.HFValidationError: Repo id must use alphanumeric chars, '-', '_' or '.'. The name cannot start or end with '-' or '.' and the maximum length is 96: 'minishlab\potion-base-8M'.

It seems like an error with this line or the logic here: https://github.com/MinishLab/model2vec/pull/305/changes#diff-a2534fe222d6835afb1915976f974133214d04c80e9769f49e24c89c06afb971R101 with it switching the forward slash to a backslash.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions