mrm8488 / mamba-coder

huggingface.co
Total runs: 72
24-hour runs: 0
7-day runs: 32
30-day runs: 32
Model's Last Updated: January 24 2024
text-generation

Introduction of mamba-coder

Model Details of mamba-coder

Mamba-Coder

MAMBA (2.8B) 🐍 fine-tuned on CodeAlpaca_20k for code generation
mamba-coder logo
Base model info

Mamba is a new state space model architecture showing promising performance on information-dense data such as language modeling, where previous subquadratic models fall short of Transformers. It is based on the line of progress on structured state space models , with an efficient hardware-aware design and implementation in the spirit of FlashAttention .

Dataset info

CodeAlpaca_20K : contains 20K instruction-following data used for fine-tuning the Code Alpaca model.

Usage
pip install torch==2.1.0 transformers==4.35.0 causal-conv1d==1.0.0 mamba-ssm==1.0.1
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
from mamba_ssm.models.mixer_seq_simple import MambaLMHeadModel

CHAT_TEMPLATE_ID = "HuggingFaceH4/zephyr-7b-beta"

device = "cuda:0" if torch.cuda.is_available() else "cpu"
model_name = "mrm8488/mamba-coder"

eos_token = "<|endoftext|>"
tokenizer = AutoTokenizer.from_pretrained(model_name)
tokenizer.eos_token = eos_token
tokenizer.pad_token = tokenizer.eos_token
tokenizer.chat_template = AutoTokenizer.from_pretrained(CHAT_TEMPLATE_ID).chat_template

model = MambaLMHeadModel.from_pretrained(
        model_name, device=device, dtype=torch.float16)

messages = []
prompt = "Write a bash script to remove .tmp files"
messages.append(dict(role="user", content=prompt))

input_ids = tokenizer.apply_chat_template(
            messages, return_tensors="pt", add_generation_prompt=True
).to(device)

out = model.generate(
    input_ids=input_ids,
    max_length=2000,
    temperature=0.9,
    top_p=0.7,
    eos_token_id=tokenizer.eos_token_id,
)

decoded = tokenizer.batch_decode(out)
assistant_message = (
    decoded[0].split("<|assistant|>\n")[-1].replace(eos_token, "")
)

print(assistant_message)
Gradio Demo
git clone https://github.com/mrm8488/mamba-chat.git
cd mamba-chat

pip install -r requirements.txt
pip install -q gradio==4.8.0

python app.py \
--model mrm8488/mamba-coder \
--share
Evaluations

Coming soon!

Citation
@misc {manuel_romero_2024,
    author       = { {Manuel Romero} },
    title        = { mamba-coder (Revision 214a13a) },
    year         = 2024,
    url          = { https://huggingface.co/mrm8488/mamba-coder },
    doi          = { 10.57967/hf/1673 },
    publisher    = { Hugging Face }
}
Acknowledgments

Thanks to mamba-chat for heavily inspiring our work

Runs of mrm8488 mamba-coder on huggingface.co

72
Total runs
0
24-hour runs
10
3-day runs
32
7-day runs
32
30-day runs

More Information About mamba-coder huggingface.co Model

More mamba-coder license Visit here:

https://choosealicense.com/licenses/wtfpl

mamba-coder huggingface.co

mamba-coder huggingface.co is an AI model on huggingface.co that provides mamba-coder's model effect (), which can be used instantly with this mrm8488 mamba-coder model. huggingface.co supports a free trial of the mamba-coder model, and also provides paid use of the mamba-coder. Support call mamba-coder model through api, including Node.js, Python, http.

mamba-coder huggingface.co Url

https://huggingface.co/mrm8488/mamba-coder

mrm8488 mamba-coder online free

mamba-coder huggingface.co is an online trial and call api platform, which integrates mamba-coder's modeling effects, including api services, and provides a free online trial of mamba-coder, you can try mamba-coder online for free by clicking the link below.

mrm8488 mamba-coder online free url in huggingface.co:

https://huggingface.co/mrm8488/mamba-coder

mamba-coder install

mamba-coder is an open source model from GitHub that offers a free installation service, and any user can find mamba-coder on GitHub to install. At the same time, huggingface.co provides the effect of mamba-coder install, users can directly use mamba-coder installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

mamba-coder install url in huggingface.co:

https://huggingface.co/mrm8488/mamba-coder

Url of mamba-coder

mamba-coder huggingface.co Url

Provider of mamba-coder huggingface.co

mrm8488
ORGANIZATIONS

Other API from mrm8488

huggingface.co

Total runs: 855
Run Growth: 264
Growth Rate: 30.88%
Updated:February 23 2024
huggingface.co

Total runs: 224
Run Growth: 75
Growth Rate: 35.21%
Updated:March 19 2023
huggingface.co

Total runs: 65
Run Growth: 50
Growth Rate: 83.33%
Updated:June 20 2023