Skip to content

Commit

Permalink
Clarify query duration in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
philippgille committed Mar 16, 2024
1 parent 579fd46 commit 5656523
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion examples/rag-wikipedia-ollama/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The output can differ slightly on each run, but it's along the lines of:
2024/03/02 20:02:34 Reading JSON lines...
2024/03/02 20:02:34 Adding documents to chromem-go, including creating their embeddings via Ollama API...
2024/03/02 20:03:11 Querying chromem-go...
2024/03/02 20:03:11 Search took 231.672667ms
2024/03/02 20:03:11 Search (incl query embedding) took 231.672667ms
2024/03/02 20:03:11 Document 1 (similarity: 0.723627): "Malleable Iron Range Company was a company that existed from 1896 to 1985 and primarily produced kitchen ranges made of malleable iron but also produced a variety of other related products. The company's primary trademark was 'Monarch' and was colloquially often referred to as the Monarch Company or just Monarch."
2024/03/02 20:03:11 Document 2 (similarity: 0.550584): "The American Motor Car Company was a short-lived company in the automotive industry founded in 1906 lasting until 1913. It was based in Indianapolis Indiana United States. The American Motor Car Company pioneered the underslung design."
2024/03/02 20:03:11 Asking LLM with augmented question...
Expand Down
4 changes: 2 additions & 2 deletions examples/rag-wikipedia-ollama/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func main() {
if err != nil {
panic(err)
}
log.Println("Search took", time.Since(start))
log.Println("Search (incl query embedding) took", time.Since(start))
// Here you could filter out any documents whose similarity is below a certain threshold.
// if docRes[...].Similarity < 0.5 { ...

Expand All @@ -129,7 +129,7 @@ func main() {
2024/03/02 20:02:34 Reading JSON lines...
2024/03/02 20:02:34 Adding documents to chromem-go, including creating their embeddings via Ollama API...
2024/03/02 20:03:11 Querying chromem-go...
2024/03/02 20:03:11 Search took 231.672667ms
2024/03/02 20:03:11 Search (incl query embedding) took 231.672667ms
2024/03/02 20:03:11 Document 1 (similarity: 0.723627): "Malleable Iron Range Company was a company that existed from 1896 to 1985 and primarily produced kitchen ranges made of malleable iron but also produced a variety of other related products. The company's primary trademark was 'Monarch' and was colloquially often referred to as the Monarch Company or just Monarch."
2024/03/02 20:03:11 Document 2 (similarity: 0.550584): "The American Motor Car Company was a short-lived company in the automotive industry founded in 1906 lasting until 1913. It was based in Indianapolis Indiana United States. The American Motor Car Company pioneered the underslung design."
2024/03/02 20:03:11 Asking LLM with augmented question...
Expand Down
6 changes: 3 additions & 3 deletions examples/semantic-search-arxiv-openai/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ This is not a retrieval augmented generation (RAG) app, because after *retrievin
1. Ensure you have [ripgrep](https://github.com/BurntSushi/ripgrep) installed, or adapt the following commands to use grep
2. Run `rg '"categories":"cs.CL"' ~/Downloads/arxiv-metadata-oai-snapshot.json | rg '"update_date":"2023' > /tmp/arxiv_cs-cl_2023.jsonl` (adapt input file path if necessary)
3. Check the data
1. `wc -l arxiv_cs-cl_2023.jsonl` should show ~5,000 lines
2. `du -h arxiv_cs-cl_2023.jsonl` should show ~8.8 MB
1. `wc -l /tmp/arxiv_cs-cl_2023.jsonl` should show ~5,000 lines
2. `du -h /tmp/arxiv_cs-cl_2023.jsonl` should show ~8.8 MB
2. Set the OpenAI API key in your env as `OPENAI_API_KEY`
3. Run the example: `go run .`

Expand All @@ -27,7 +27,7 @@ The output can differ slightly on each run, but it's along the lines of:
2024/03/10 18:23:55 Read and parsed 5006 documents.
2024/03/10 18:23:55 Adding documents to chromem-go, including creating their embeddings via OpenAI API...
2024/03/10 18:28:12 Querying chromem-go...
2024/03/10 18:28:12 Search took 529.451163ms
2024/03/10 18:28:12 Search (incl query embedding) took 529.451163ms
2024/03/10 18:28:12 Search results:
1) Similarity 0.488895:
URL: https://arxiv.org/abs/2209.15469
Expand Down
4 changes: 2 additions & 2 deletions examples/semantic-search-arxiv-openai/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func main() {
if err != nil {
panic(err)
}
log.Println("Search took", time.Since(start))
log.Println("Search (incl query embedding) took", time.Since(start))
// Here you could filter out any documents whose similarity is below a certain threshold.
// if docRes[...].Similarity < 0.5 { ...

Expand All @@ -117,7 +117,7 @@ func main() {
2024/03/10 18:23:55 Read and parsed 5006 documents.
2024/03/10 18:23:55 Adding documents to chromem-go, including creating their embeddings via OpenAI API...
2024/03/10 18:28:12 Querying chromem-go...
2024/03/10 18:28:12 Search took 529.451163ms
2024/03/10 18:28:12 Search (incl query embedding) took 529.451163ms
2024/03/10 18:28:12 Search results:
1) Similarity 0.488895:
URL: https://arxiv.org/abs/2209.15469
Expand Down

0 comments on commit 5656523

Please sign in to comment.