Views
No views yet
| Name | Quant method | Size |
|---|---|---|
| mamba-790m-hf.Q2_K.gguf | Q2_K | 0.4GB |
| mamba-790m-hf.IQ3_XS.gguf | IQ3_XS | 0.47GB |
| mamba-790m-hf.IQ3_S.gguf | IQ3_S | 0.47GB |
| mamba-790m-hf.Q3_K_S.gguf | Q3_K_S | 0.47GB |
| mamba-790m-hf.IQ3_M.gguf | IQ3_M | 0.47GB |
| mamba-790m-hf.Q3_K.gguf | Q3_K | 0.47GB |
| mamba-790m-hf.Q3_K_M.gguf | Q3_K_M | 0.47GB |
| mamba-790m-hf.Q3_K_L.gguf | Q3_K_L | 0.47GB |
| mamba-790m-hf.IQ4_XS.gguf | IQ4_XS | 0.53GB |
| mamba-790m-hf.Q4_0.gguf | Q4_0 | 0.55GB |
| mamba-790m-hf.IQ4_NL.gguf | IQ4_NL | 0.55GB |
| mamba-790m-hf.Q4_K_S.gguf | Q4_K_S | 0.55GB |
| mamba-790m-hf.Q4_K.gguf | Q4_K | 0.55GB |
| mamba-790m-hf.Q4_K_M.gguf | Q4_K_M | 0.55GB |
| mamba-790m-hf.Q4_1.gguf | Q4_1 | 0.59GB |
| mamba-790m-hf.Q5_0.gguf | Q5_0 | 0.63GB |
| mamba-790m-hf.Q5_K_S.gguf | Q5_K_S | 0.63GB |
| mamba-790m-hf.Q5_K.gguf | Q5_K | 0.63GB |
| mamba-790m-hf.Q5_K_M.gguf | Q5_K_M | 0.63GB |
| mamba-790m-hf.Q5_1.gguf | Q5_1 | 0.67GB |
| mamba-790m-hf.Q6_K.gguf | Q6_K | 0.72GB |
| mamba-790m-hf.Q8_0.gguf | Q8_0 | 0.89GB |
transfromers compatible mamba-2.8b. The checkpoints are untouched, but the full config.json and tokenizer are pushed to this repo.transformers from main until transformers=4.39.0 is released.pip install git+https://github.com/huggingface/transformers@maincausal_conv_1d and mamba-ssm using:1pip install causal-conv1d>=1.2.0
2pip install mamba-ssmcuda kernels will be used.generate API:1>>> from transformers import MambaConfig, MambaForCausalLM, AutoTokenizer
2>>> import torch
3
4>>> tokenizer = AutoTokenizer.from_pretrained("state-spaces/mamba-790m-hf")
5>>> model = MambaForCausalLM.from_pretrained("state-spaces/mamba-790m-hf")
6>>> input_ids = tokenizer("Hey how are you doing?", return_tensors="pt")["input_ids"]
7
8>>> out = model.generate(input_ids, max_new_tokens=10)
9>>> print(tokenizer.batch_decode(out))
10["Hey how are you doing?\n\nI'm good.\n\nHow are"]peft library, we recommend keeping the model in float32!1from datasets import load_dataset
2from trl import SFTTrainer
3from peft import LoraConfig
4from transformers import AutoTokenizer, AutoModelForCausalLM, TrainingArguments
5tokenizer = AutoTokenizer.from_pretrained("state-spaces/mamba-790m-hf")
6model = AutoModelForCausalLM.from_pretrained("state-spaces/mamba-790m-hf")
7dataset = load_dataset("Abirate/english_quotes", split="train")
8training_args = TrainingArguments(
9 output_dir="./results",
10 num_train_epochs=3,
11 per_device_train_batch_size=4,
12 logging_dir='./logs',
13 logging_steps=10,
14 learning_rate=2e-3
15)
16lora_config = LoraConfig(
17 r=8,
18 target_modules=["x_proj", "embeddings", "in_proj", "out_proj"],
19 task_type="CAUSAL_LM",
20 bias="none"
21)
22trainer = SFTTrainer(
23 model=model,
24 tokenizer=tokenizer,
25 args=training_args,
26 peft_config=lora_config,
27 train_dataset=dataset,
28 dataset_text_field="quote",
29)
30trainer.train()