Update README.md
Browse files
README.md
CHANGED
@@ -15,6 +15,38 @@ tags:
|
|
15 |
library_name: transformers
|
16 |
---
|
17 |
|
18 |
-
|
19 |
|
20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
library_name: transformers
|
16 |
---
|
17 |
|
18 |
+
## Model Information
|
19 |
|
20 |
+
BrainCog is developed by BrainCog group.
|
21 |
+
|
22 |
+
Current version is BrainCog-8B-0.1-Instruct.
|
23 |
+
|
24 |
+
## Use with transformers
|
25 |
+
|
26 |
+
|
27 |
+
```python
|
28 |
+
import torch
|
29 |
+
import transformers
|
30 |
+
|
31 |
+
model_id = "sunbaby/BrainCog-8B-0.1-Instruct"
|
32 |
+
pipeline = transformers.pipeline(
|
33 |
+
"text-generation",
|
34 |
+
model=model_id,
|
35 |
+
model_kwargs={
|
36 |
+
"torch_dtype": torch.bfloat16
|
37 |
+
},
|
38 |
+
device_map="auto",
|
39 |
+
)
|
40 |
+
messages = [
|
41 |
+
{"role": "system", "content": "You are a useful chatbot or assistant to help people."},
|
42 |
+
{"role": "user", "content": "How are you?"},
|
43 |
+
]
|
44 |
+
outputs = pipeline(
|
45 |
+
messages,
|
46 |
+
max_new_tokens=2048,
|
47 |
+
)
|
48 |
+
print(outputs[0]["generated_text"][-1])
|
49 |
+
```
|
50 |
+
|
51 |
+
## Responsibility
|
52 |
+
The output of the model is uncontrollable, and its output does not represent our opinion
|