CobraMamba
commited on
Commit
•
25fd7b2
1
Parent(s):
900f740
Update README.md
Browse files
README.md
CHANGED
@@ -46,3 +46,43 @@ The training code and data will be open sourced later on Github(https://github.c
|
|
46 |
|
47 |
We have fine-tuned the open-lama model and surpassed the original model in multiple evaluation subtasks, making it currently the best performing 3B model with comparable performance to llama-7b
|
48 |
- Base model: [openlm-research/open_llama_3b_v2](https://huggingface.co/openlm-research/open_llama_3b_v2)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
|
47 |
We have fine-tuned the open-lama model and surpassed the original model in multiple evaluation subtasks, making it currently the best performing 3B model with comparable performance to llama-7b
|
48 |
- Base model: [openlm-research/open_llama_3b_v2](https://huggingface.co/openlm-research/open_llama_3b_v2)
|
49 |
+
|
50 |
+
|
51 |
+
## Usage
|
52 |
+
|
53 |
+
To use the model with the `transformers` library on a machine with GPUs, first make sure you have the `transformers`, `accelerate` and `torch` libraries installed.
|
54 |
+
|
55 |
+
```bash
|
56 |
+
pip install transformers==4.29.2
|
57 |
+
pip install accelerate==0.19.0
|
58 |
+
pip install torch==2.0.0
|
59 |
+
```
|
60 |
+
|
61 |
+
```python
|
62 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
63 |
+
|
64 |
+
tokenizer = AutoTokenizer.from_pretrained("CobraMamba/mamba-gpt-3b-v4")
|
65 |
+
model = AutoModelForCausalLM.from_pretrained("CobraMamba/mamba-gpt-3b-v4", trust_remote_code=True, torch_dtype=torch.float16)
|
66 |
+
|
67 |
+
# we use alpaca prompt
|
68 |
+
input_context = "Your text here"
|
69 |
+
input_ids = tokenizer.encode(input_context, return_tensors="pt")
|
70 |
+
output = model.generate(input_ids, max_length=128, temperature=0.7)
|
71 |
+
output_text = tokenizer.decode(output[0], skip_special_tokens=True)
|
72 |
+
print(output_text)
|
73 |
+
|
74 |
+
```
|
75 |
+
|
76 |
+
|
77 |
+
## Citation
|
78 |
+
|
79 |
+
If this work is helpful, please kindly cite as:
|
80 |
+
|
81 |
+
```bibtex
|
82 |
+
@Misc{mamba-gpt-3b-v4,
|
83 |
+
title = {Mamba-GPT-3b-v4},
|
84 |
+
author = {chiliu},
|
85 |
+
howpublished = {\url{https://huggingface.co/CobraMamba/mamba-gpt-3b-v4}},
|
86 |
+
year = {2023}
|
87 |
+
}
|
88 |
+
```
|