Closed lukesalamone closed 3 years ago
can you share a sample of what your passages file looks like? I can run the model just fine on my end with the default settings:
$ parlai interactive -mf zoo:hallucination/bart_rag_turn_dtt/model
.
.
.
Enter Your Message: what is the capital of spain?
[Rag]: Madrid is the capital of Spain, but there are many other major urban areas like Barcelona, Valencia, Seville, Málaga and Bilbao.
@klshuster Originally I was using a custom file with different data in the TSV. But even when I change my input TSV file to contain only one line (besides the headers) I still get the same AssertionError: TreeSearch returned a finalized hypo with multiple end tokens with score nan
error:
x\tChicago, officially the City of Chicago, is the most populous city in the U.S. state of Illinois, and the third most populous city in the United States, following New York and Los Angeles. With an estimated population of 2,693,976 in 2019, it is also the most populous city in the Midwestern United States and the fifth most populous city in North America. Chicago is the county seat of Cook County, the second most populous county in the U.S., while a small portion of the city's O'Hare Airport also extends into DuPage County. Chicago is the principal city of the Chicago metropolitan area, defined as either the U.S. Census Bureau's metropolitan statistical area (9.4 million people) or the combined statistical area (almost 10 million residents), often called Chicagoland. It constitutes the third most populous urban area in the United States after New York City and Los Angeles and is one of the 40 largest urban areas in the world.\tChicago
This line is repeated 9999 times in my file. I ran the embedding script and the indexing script and the issue persists.
Here's the file for reference. Github won't let me upload TSV files so I changed the extension to CSV (just change it back to TSV). chicago.csv
When I print out the lines it's trying to decode I get
11:59:39 | Decoding error: tensor([1, 3, 2], device='cuda:0')
11:59:39 | Decoding error: tensor([1, 3, 2, 3, 2], device='cuda:0')
11:59:39 | Decoding error: tensor([1, 3, 2, 3, 2, 4, 2], device='cuda:0')
I think 1 is start of sequence, 2 is end of sequence, and 3 is UNK. So it seems like the model is basically generating nonsense.
ok, I am able to repro your issue so I'm looking into it now
ok, looks like scores for the retrieved documents are NaNs; this probably indicates something is going wrong with the index building (this makes sense for the provided chicago.tsv
as we're building a clustered index where all the vectors are the same...)
I'll be putting up a patch shortly that catches and handles this; in the meantime, perhaps try building an exact index with --indexer-type exact
in the index_dense_embeddings
script (and then setting that parameter when in interactive as well).
edit: I investigated the indices returned from searching the index and they are all -1
, which indicates that something is going wrong with the index building: https://github.com/facebookresearch/faiss/issues/244
The fix for this has merged, feel free to reopen (or file a new issue and tag me) if you continue to run into problems
Bug description I am following the instructions for indexing my own documents with a FAISS index: https://www.parl.ai/docs/agent_refs/rag.html#generating-your-own-faiss-index
Reproduction steps
I generated the embeddings with the following:
Then I indexed the embeddings
Then I tried to to run the model in interactive mode:
Expected behavior I expect to be able to run the model in interactive mode without errors.
Logs