ssmits commited on
Commit
a31126a
1 Parent(s): 343e8e5

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +10 -0
README.md CHANGED
@@ -91,4 +91,14 @@ sentence_embeddings = mean_pooling(model_output, encoded_input['attention_mask']
91
 
92
  print("Sentence embeddings:")
93
  print(sentence_embeddings)
 
 
 
 
 
 
 
 
 
 
94
  ```
 
91
 
92
  print("Sentence embeddings:")
93
  print(sentence_embeddings)
94
+ ```
95
+
96
+ ### How to enable Multi-GPU
97
+ ```python
98
+ from transformers import AutoModel
99
+ from torch.nn import DataParallel
100
+
101
+ embedding_model = AutoModel.from_pretrained("ssmits/Qwen2-7B-embed-base")
102
+ for module_key, module in embedding_model._modules.items():
103
+ embedding_model._modules[module_key] = DataParallel(module)
104
  ```