Instructions to use gem-search/GEM-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use gem-search/GEM-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="gem-search/GEM-4B", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("gem-search/GEM-4B", trust_remote_code=True) model = AutoModel.from_pretrained("gem-search/GEM-4B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -87,6 +87,8 @@ print(q_embs @ doc_embs.T)
|
|
| 87 |
```
|
| 88 |
|
| 89 |
#### 2.3 Use custom prompt
|
|
|
|
|
|
|
| 90 |
By default, GEM uses a reasoning prompt. You may explicitly set your own prompt based on your tasks. Here is an example to use GEM for conventional query expansion:
|
| 91 |
|
| 92 |
```python
|
|
|
|
| 87 |
```
|
| 88 |
|
| 89 |
#### 2.3 Use custom prompt
|
| 90 |
+
In GEM, embedding can be viewed as an additional skill learned by the backbone LLM; the model remains _promptable_.
|
| 91 |
+
|
| 92 |
By default, GEM uses a reasoning prompt. You may explicitly set your own prompt based on your tasks. Here is an example to use GEM for conventional query expansion:
|
| 93 |
|
| 94 |
```python
|