Skip to content

Commit

Permalink
docs: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
LongxingTan committed Mar 11, 2024
1 parent 58d0232 commit 5f1c856
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,17 @@ trainer.train()

**Finetune LLM for embedding by Contrastive learning**
```python
# just change the model in AutoModelForEmbedding

from retrievals import AutoModelForEmbedding

model = AutoModelForEmbedding('llama', pooling_method='last', query_instruction='')
model = AutoModelForEmbedding(
"mistralai/Mistral-7B-v0.1",
pooling_method='cls',
query_instruction=f'Instruct: Retrieve semantically similar text\nQuery: '
)
```

**Search by KNN**
**Search by Cosine similarity/KNN**
```python
from retrievals import AutoModelForEmbedding, AutoModelForMatch

Expand Down

0 comments on commit 5f1c856

Please sign in to comment.