Slightly update Sentence Transformers snippet (#2)
Browse files- Use the trust_remote_code parameter immediately (4cfebc7f5b6f76487db2c8d48a35978d993ed5ab)
README.md
CHANGED
|
@@ -61,7 +61,11 @@ from sentence_transformers import SentenceTransformer
|
|
| 61 |
import torch
|
| 62 |
|
| 63 |
# Load the model, optionally in float16 precision for faster inference
|
| 64 |
-
model = SentenceTransformer(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
|
| 66 |
# Prepare a prompt given an instruction
|
| 67 |
instruction = 'Given a question in text, retrieve SQL queries that are appropriate responses to the question.'
|
|
|
|
| 61 |
import torch
|
| 62 |
|
| 63 |
# Load the model, optionally in float16 precision for faster inference
|
| 64 |
+
model = SentenceTransformer(
|
| 65 |
+
"BAAI/bge-code-v1",
|
| 66 |
+
trust_remote_code=True,
|
| 67 |
+
model_kwargs={"torch_dtype": torch.float16},
|
| 68 |
+
)
|
| 69 |
|
| 70 |
# Prepare a prompt given an instruction
|
| 71 |
instruction = 'Given a question in text, retrieve SQL queries that are appropriate responses to the question.'
|