sedrickkeh
commited on
Update README.md
Browse files
README.md
CHANGED
@@ -139,11 +139,14 @@ print(output)
|
|
139 |
# Machine learning is a branch of artificial intelligence (AI) that enables computers to learn from experience without being explicitly programmed. Machine learning is used in a wide range of applications, including spam filtering, image recognition, speech recognition, and computer-based medical diagnosis
|
140 |
```
|
141 |
|
142 |
-
The Mistral-SUPRA model can be used both in parallel mode and in recurrent mode. If `use_cache` is set to `False` for `model.generate(...)`, then it will use
|
143 |
The recurrent model uses `xformers` and requires the inputs and models to be loaded to GPU.
|
144 |
|
145 |
```python
|
146 |
# Recurrent mode
|
|
|
|
|
|
|
147 |
output = model.to('cuda').generate(inputs['input_ids'].to('cuda'), use_cache=False, **gen_kwargs)
|
148 |
```
|
149 |
|
|
|
139 |
# Machine learning is a branch of artificial intelligence (AI) that enables computers to learn from experience without being explicitly programmed. Machine learning is used in a wide range of applications, including spam filtering, image recognition, speech recognition, and computer-based medical diagnosis
|
140 |
```
|
141 |
|
142 |
+
The Mistral-SUPRA model can be used both in parallel mode and in recurrent mode. If `use_cache` is set to `False` for `model.generate(...)`, then it will use parallel mode; otherwise, it will use recurrent mode.
|
143 |
The recurrent model uses `xformers` and requires the inputs and models to be loaded to GPU.
|
144 |
|
145 |
```python
|
146 |
# Recurrent mode
|
147 |
+
output = model.to('cuda').generate(inputs['input_ids'].to('cuda'), use_cache=True, **gen_kwargs)
|
148 |
+
|
149 |
+
# Parallel mode
|
150 |
output = model.to('cuda').generate(inputs['input_ids'].to('cuda'), use_cache=False, **gen_kwargs)
|
151 |
```
|
152 |
|