cfli commited on
Commit
d44b53c
·
verified ·
1 Parent(s): 3fa24f3

Slightly update Sentence Transformers snippet (#2)

Browse files

- Use the trust_remote_code parameter immediately (4cfebc7f5b6f76487db2c8d48a35978d993ed5ab)

Files changed (1) hide show
  1. README.md +5 -1
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("BAAI/bge-code-v1", model_kwargs={"torch_dtype": torch.float16, "trust_remote_code": True}, tokenizer_kwargs={"trust_remote_code": True})
 
 
 
 
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.'