Views
No views yet
transformers library on a machine with GPU(s), first make sure you have the transformers, accelerate and torch libraries installed.1from transformers import AutoTokenizer, AutoModelForCausalLM
2
3tokenizer = AutoTokenizer.from_pretrained("CobraMamba/mamba-gpt-7b-v2")
4model = AutoModelForCausalLM.from_pretrained("CobraMamba/mamba-gpt-7b-v2", trust_remote_code=True, torch_dtype=torch.float16)
5
6input_content = "Your text here"
7input_ids = tokenizer.encode(input_content, return_tensors="pt")
8output = model.generate(input_ids, max_length=128, temperature=0.7)
9output_text = tokenizer.decode(output[0], skip_special_tokens=True)
10print(output_text)
111@Misc{mamba-gpt-7b-v2,
2 title = {Mamba-GPT-7b-v2},
3 author = {chiliu},
4 howpublished = {\url{https://huggingface.co/CobraMamba/mamba-gpt-7b-v2}},
5 year = {2023}
6}| Metric | Value |
|---|---|
| Avg. | 54.85 |
| ARC (25-shot) | 61.95 |
| HellaSwag (10-shot) | 83.83 |
| MMLU (5-shot) | 61.74 |
| TruthfulQA (0-shot) | 46.63 |
| Winogrande (5-shot) | 78.45 |
| GSM8K (5-shot) | 17.29 |
| DROP (3-shot) | 34.07 |