Instructions to use codefuse-ai/F2LLM-v2-14B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use codefuse-ai/F2LLM-v2-14B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="codefuse-ai/F2LLM-v2-14B")# Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("codefuse-ai/F2LLM-v2-14B") model = AutoModel.from_pretrained("codefuse-ai/F2LLM-v2-14B") - sentence-transformers
How to use codefuse-ai/F2LLM-v2-14B with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("codefuse-ai/F2LLM-v2-14B") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -183,6 +183,22 @@ print(similarity)
|
|
| 183 |
# dtype=torch.bfloat16, grad_fn=<MmBackward0>)
|
| 184 |
```
|
| 185 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 186 |
## Intermediate Checkpoints
|
| 187 |
|
| 188 |
To facilitate future research, we release intermediate checkpoints in the `intermediate_checkpoints` branch.
|
|
|
|
| 183 |
# dtype=torch.bfloat16, grad_fn=<MmBackward0>)
|
| 184 |
```
|
| 185 |
|
| 186 |
+
### Prompts
|
| 187 |
+
|
| 188 |
+
The model supports custom instructions in the following format:
|
| 189 |
+
|
| 190 |
+
```text
|
| 191 |
+
Instruct: your_instruction
|
| 192 |
+
Query:
|
| 193 |
+
```
|
| 194 |
+
|
| 195 |
+
In general, for retrieval and reranking tasks:
|
| 196 |
+
|
| 197 |
+
- use the prompt for queries
|
| 198 |
+
- do not prepend the prompt to documents/passages
|
| 199 |
+
|
| 200 |
+
For symmetric tasks such as STS, clustering, and bitext mining, you can encode the documents either with or without prompts. The model is trained to support both scenarios.
|
| 201 |
+
|
| 202 |
## Intermediate Checkpoints
|
| 203 |
|
| 204 |
To facilitate future research, we release intermediate checkpoints in the `intermediate_checkpoints` branch.
|