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

Cannot build index with dense representations #1581

Closed
felicitywang1 opened this issue Jul 25, 2023 · 5 comments
Closed

Cannot build index with dense representations #1581

felicitywang1 opened this issue Jul 25, 2023 · 5 comments

Comments

@felicitywang1
Copy link

Hi,
I followed the instructions here (with some modifications to run locally on mac cpu) and got the following NoneType error. Any suggestions how I should fix it?

Thank you.

python -m pyserini.encode \
  input   --corpus tests/resources/simple_cacm_corpus.jsonl \
          --fields text \
  output  --embeddings indexes/tests/simple_cacm_corpus \
          --to-faiss \
  encoder --encoder castorini/tct_colbert-v2-hnp-msmarco \
          --fields text

Traceback (most recent call last):
File "/Users/f.wang1/miniconda3/envs/transformers/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/Users/f.wang1/miniconda3/envs/transformers/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/Users/f.wang1/miniconda3/envs/transformers/lib/python3.8/site-packages/pyserini/encode/main.py", line 118, in
encoder = init_encoder(args.encoder.encoder, args.encoder.encoder_class, device=args.encoder.device)
AttributeError: 'NoneType' object has no attribute 'encoder'
zsh: command not found: output

@lintool
Copy link
Member

lintool commented Jul 25, 2023

@felicitywang1
Copy link
Author

Thanks. With the command in there on cpu and some other tweaks I managed to get it running :)

@lintool
Copy link
Member

lintool commented Jul 25, 2023

hi @felicitywang1 can you share what the command was so the next person doesn't need to figure it out from scratch again? ;)

@felicitywang1
Copy link
Author

felicitywang1 commented Jul 25, 2023

It's exactly the same as in https://github.com/castorini/pyserini/blob/master/tests/test_encoder.py#L85 ...
If one's working with a cpu as I am

@lintool
Copy link
Member

lintool commented Jul 25, 2023

Gotcha, thanks!

Glad the test cases are doing their jobs...

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

2 participants