Skip to content

Commit

Permalink
fix sample app and add link (#1398)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jo Kristian Bergum authored Mar 1, 2024
1 parent 2a7ed3e commit bcb716e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
6 changes: 4 additions & 2 deletions colbert-long/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@ with extended context windows for long-document retrieval.
The app demonstrates the [colbert-embedder](https://docs.vespa.ai/en/embedding.html#colbert-embedder) and
the tensor expressions for performing two types of extended ColBERT late-interaction for long-context retrieval.

<p data-test="run-macro init-deploy long-colbert">
See [Announcing Vespa Long-Context ColBERT](https://blog.vespa.ai/announcing-long-context-colbert-in-vespa/) for details on this application.

<p data-test="run-macro init-deploy colbert-long">
Requires at least Vespa 8.311.28
</p>

## To try this application

Follow [Vespa getting started](https://cloud.vespa.ai/en/getting-started)
through the <code>vespa deploy</code> step, cloning `long-colbert` instead of `album-recommendation`.
through the <code>vespa deploy</code> step, cloning `colbert-long` instead of `album-recommendation`.

Feed documents (this includes embed inference in Vespa):
<pre data-test="exec">
Expand Down
5 changes: 2 additions & 3 deletions colbert-long/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<transformer-model url="https://huggingface.co/colbert-ir/colbertv2.0/resolve/main/model.onnx"/>
<tokenizer-model url="https://huggingface.co/colbert-ir/colbertv2.0/raw/main/tokenizer.json"/>
</component>

<document-api/>
<search/>
<nodes count="1">
Expand All @@ -23,7 +22,7 @@

<!-- See https://docs.vespa.ai/en/reference/services-content.html -->
<content id="text" version="1.0">
<redundancy>2</redundancy>
<min-redundancy>2</min-redundancy>
<documents>
<document type="doc" mode="index" />
</documents>
Expand All @@ -33,7 +32,7 @@
<tuning>
<searchnode>
<requestthreads>
<persearch>16</persearch> <!-- Change the number of threads per search here -->
<persearch>4</persearch> <!-- Change the number of threads per search here -->
</requestthreads>
</searchnode>
</tuning>
Expand Down
8 changes: 4 additions & 4 deletions colbert/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ It also features reciprocal rank fusion to fuse different rankings.


<p data-test="run-macro init-deploy colbert">
Requires at least Vespa 8.283.46
Requires at least Vespa 8.311.28
</p>

## To try this application
Expand All @@ -36,21 +36,21 @@ Example queries:
<pre data-test="exec" data-test-assert-contains="id:doc:doc::1">
vespa query 'yql=select * from doc where userQuery() or ({targetHits: 100}nearestNeighbor(embedding, q))'\
'input.query(q)=embed(e5, "query: space contains many suns")' \
'input.query(qt)=embed(colbert, "space contains many suns")' \
'input.query(qt)=embed(colbert, @query)' \
'query=space contains many suns'
</pre>

<pre data-test="exec" data-test-assert-contains="id:doc:doc::1">
vespa query 'yql=select * from doc where userQuery() or ({targetHits: 100}nearestNeighbor(embedding, q))'\
'input.query(q)=embed(e5, "query: shipping stuff over the sea")' \
'input.query(qt)=embed(colbert, "shipping stuff over the sea")' \
'input.query(qt)=embed(colbert, @query)' \
'query=shipping stuff over the sea'
</pre>

<pre data-test="exec" data-test-assert-contains="id:doc:doc::1">
vespa query 'yql=select * from doc where userQuery() or ({targetHits: 100}nearestNeighbor(embedding, q))'\
'input.query(q)=embed(e5, "query: exchanging information by sound")' \
'input.query(qt)=embed(colbert, "exchanging information by sound")' \
'input.query(qt)=embed(colbert, @query)' \
'query=exchanging information by sound'
</pre>

Expand Down
2 changes: 1 addition & 1 deletion colbert/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

<!-- See https://docs.vespa.ai/en/reference/services-content.html -->
<content id="text" version="1.0">
<redundancy>2</redundancy>
<min-redundancy>2</min-redundancy>
<documents>
<document type="doc" mode="index" />
</documents>
Expand Down

0 comments on commit bcb716e

Please sign in to comment.