Update README.md
Browse files
README.md
CHANGED
@@ -15,4 +15,18 @@ This repo contains a large ocean generative model (OceanGPT) built with ocean sc
|
|
15 |
You can use the model to generate responses or input a partial structure for the model to complete.
|
16 |
|
17 |
## 🛠️ How to use
|
18 |
-
We wil provide several examples soon and you can modify the input according to your needs.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
You can use the model to generate responses or input a partial structure for the model to complete.
|
16 |
|
17 |
## 🛠️ How to use
|
18 |
+
We wil provide several examples soon and you can modify the input according to your needs.
|
19 |
+
|
20 |
+
```python
|
21 |
+
# Use a pipeline as a high-level helper
|
22 |
+
>>> from transformers import pipeline
|
23 |
+
|
24 |
+
>>> pipe = pipeline("text-generation", model="zjunlp/OceanGPT-7b")
|
25 |
+
|
26 |
+
# Load model directly
|
27 |
+
>>> from transformers import AutoTokenizer, AutoModelForCausalLM
|
28 |
+
|
29 |
+
>>> tokenizer = AutoTokenizer.from_pretrained("zjunlp/OceanGPT-7b")
|
30 |
+
>>> model = AutoModelForCausalLM.from_pretrained("zjunlp/OceanGPT-7b")
|
31 |
+
|
32 |
+
```
|