Update README.md
Browse files
README.md
CHANGED
|
@@ -21,4 +21,19 @@ language:
|
|
| 21 |
<image src="https://raw.githubusercontent.com/TerenceLiu98/sparrow/master/.github/sparrow.png" width="300" />
|
| 22 |
</div>
|
| 23 |
|
| 24 |
-
For more detail pleace check: [Sparrow](https://github.com/TerenceLiu98/sparrow)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
<image src="https://raw.githubusercontent.com/TerenceLiu98/sparrow/master/.github/sparrow.png" width="300" />
|
| 22 |
</div>
|
| 23 |
|
| 24 |
+
For more detail pleace check: [Sparrow](https://github.com/TerenceLiu98/sparrow)
|
| 25 |
+
|
| 26 |
+
To run the model, first download the code from huggingface:
|
| 27 |
+
|
| 28 |
+
```bash
|
| 29 |
+
git clone https://huggingface.co/TerenceLau/sparrow && cd ./sparrow/
|
| 30 |
+
```
|
| 31 |
+
|
| 32 |
+
then, you can register the `SparrowConfig` and `SparrowModel` to `AutoConfig` and `AutoModelForCausalLM`:
|
| 33 |
+
```python
|
| 34 |
+
from modelling_sparrow import SparrowModel, SparrowConfig
|
| 35 |
+
from transformers import AutoConfig, AutoModelForCausalLM, AutoTokenizer
|
| 36 |
+
AutoConfig.register("sparrow", SparrowConfig)
|
| 37 |
+
AutoModelForCausalLM.register(SparrowConfig, SparrowModel)
|
| 38 |
+
model = AutoModelForCausalLM.from_pretrained("TerenceLau/sparrow")
|
| 39 |
+
```
|