question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[rag] missing a working End-to-end evaluation example

See original GitHub issue

I’m going to try to write tests for examples/rag (https://github.com/huggingface/transformers/issues/7715), but first I’m trying to figure out how it works.

Would it be possible to add a full End-to-end evaluation invocation example in https://github.com/huggingface/transformers/blob/master/examples/rag/README.md#end-to-end-evaluation? i.e. with the correct data.

I tested https://github.com/huggingface/transformers/blob/master/examples/rag/README.md#retrieval-evaluation and it worked, but if I try to adapt the same params for e2e it crashes with:

$ python eval_rag.py --model_name_or_path facebook/rag-sequence-nq --model_type rag_sequence \
--evaluation_set output/biencoder-nq-dev.questions --gold_data_path output/biencoder-nq-dev.pages \
--predictions_path output/retrieval_preds.tsv --eval_mode e2e --gold_data_mode qa --n_docs 5 \
--print_predictions
2020-11-03 22:07:33.124277: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.11.0
INFO:__main__:Evaluate the following checkpoints: ['facebook/rag-sequence-nq']
INFO:__main__:Calculating metrics based on an existing predictions file: output/retrieval_preds.tsv
Traceback (most recent call last):
  File "eval_rag.py", line 314, in <module>
    main(args)
  File "eval_rag.py", line 280, in main
    score_fn(args, args.predictions_path, args.gold_data_path)
  File "eval_rag.py", line 46, in get_scores
    data = pd.read_csv(gold_data_path, sep="\t", header=None)
  File "/home/stas/anaconda3/envs/main-38/lib/python3.8/site-packages/pandas/io/parsers.py", line 686, in read_csv
    return _read(filepath_or_buffer, kwds)
  File "/home/stas/anaconda3/envs/main-38/lib/python3.8/site-packages/pandas/io/parsers.py", line 458, in _read
    data = parser.read(nrows)
  File "/home/stas/anaconda3/envs/main-38/lib/python3.8/site-packages/pandas/io/parsers.py", line 1196, in read
    ret = self._engine.read(nrows)
  File "/home/stas/anaconda3/envs/main-38/lib/python3.8/site-packages/pandas/io/parsers.py", line 2155, in read
    data = self._reader.read(nrows)
  File "pandas/_libs/parsers.pyx", line 847, in pandas._libs.parsers.TextReader.read
  File "pandas/_libs/parsers.pyx", line 862, in pandas._libs.parsers.TextReader._read_low_memory
  File "pandas/_libs/parsers.pyx", line 918, in pandas._libs.parsers.TextReader._read_rows
  File "pandas/_libs/parsers.pyx", line 905, in pandas._libs.parsers.TextReader._tokenize_rows
  File "pandas/_libs/parsers.pyx", line 2042, in pandas._libs.parsers.raise_parser_error
pandas.errors.ParserError: Error tokenizing data. C error: Expected 5 fields in line 2, saw 6

I think it needs a different input data.

And we need 2 functional examples: for qa and ans each.

I can handle adding this to the doc if you tell me what to add.

Thanks.

@patrickvonplaten, @lhoestq

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
lhoestqcommented, Nov 13, 2020

Actually I’m working on the finetuning script example, not eval 😉 But maybe this can help with adding a test for the eval script example.

1reaction
stas00commented, Nov 11, 2020

Until then please file a normal issue about it. I haven’t done any rag work yet, so that’s why I’m asking for support.

Read more comments on GitHub >

github_iconTop Results From Across the Web

transformers/README.md at main - rag-end2end-retriever
This extension enables complete end-to-end training of RAG including the context encoder in the retriever component. Please read the accompanying blog post for ......
Read more >
Retrieval-Augmented Generation (RAG) - ParlAI
To evaluate / interact with any pre-trained models (e.g., those mentioned ... RAG paper; the third is outlined in our retrieval-augmented dialogue work....
Read more >
Improving the Domain Adaptation of Retrieval Augmented ...
In this paper, we evaluate the impact of joint training of the retriever and generator components of RAG for the task of domain...
Read more >
Discovery of an Active RAG Transposon Illuminates the ... - NCBI
RAG1/2 are proposed to have arisen from a transposable element, but definitive evidence for this is lacking. Here we report the discovery of ......
Read more >
9. End to End Bayesian Workflows
Missing data is not always a binary condition either, it could also mean part of the data is missing. For example, failing to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found