---
title: Mini-Jamba
canonical_url: "https://www.modelscope.cn/models/TechxGenus-MS/Mini-Jamba"
md_url: "https://www.modelscope.cn/models/TechxGenus-MS/Mini-Jamba.md"
repository: TechxGenus-MS/Mini-Jamba
last_updated: 2024-12-11
license: apache-2.0
pipeline_tag: text-generation
tasks:
  - text-generation
model_type:
  - jamba
architectures:
  - JambaForCausalLM
parameters: 69.5M
tensor_type:
  - BF16
library_name:
  - pytorch
  - transformer
  - safetensors
frameworks:
  - pytorch
inference_backends:
  - "deploy_task text/emb"
  - "vllm 0.9.2"
downloads: 3002
stars: 0
tags:
  - jamba
  - mamba
  - moe
---

# Mini-Jamba

> Mini-Jamba - TechxGenus-MS 在 ModelScope 开源的模型。[Experimental Version] We initialized the model according to Jamba, but with much smaller parameters. It was then trained using about 1B of python code, and has the simplest python code generation capabilities.

TechxGenus-MS/Mini-Jamba 是 ModelScope 魔搭社区上的 69.5M 参数text-generation模型，采用 apache-2.0 许可，可用 deploy_task text/emb、vllm 0.9.2 部署。

- **Repository**: TechxGenus-MS/Mini-Jamba
- **License**: apache-2.0
- **Tasks**: text-generation
- **Parameters**: 69.5M
- **Inference backends**: deploy_task text/emb, vllm 0.9.2
- **Tags**: jamba, mamba, moe
- **Downloads**: 3002
- **Stars**: 0
- **Last updated**: 2024-12-11

Source: https://www.modelscope.cn/models/TechxGenus-MS/Mini-Jamba

---

### Mini-Jamba

[**Experimental Version**] We initialized the model according to [Jamba](https://huggingface.co/ai21labs/Jamba-v0.1), but with much smaller parameters. It was then trained using about 1B of python code, and has the simplest python code generation capabilities.

### Usage

Here give some examples of how to use our model:

```python
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch

prompt = '''def min(arr):
    """
    Returns the minimum value from the list `arr`.
    
    Parameters:
    - arr (list): A list of numerical values.
    
    Returns:
    - The minimum value in `arr`.
    """
'''

tokenizer = AutoTokenizer.from_pretrained(
    "TechxGenus/Mini-Jamba",
    trust_remote_code=True,
)
tokenizer.pad_token = tokenizer.eos_token
model = AutoModelForCausalLM.from_pretrained(
    "TechxGenus/Mini-Jamba",
    torch_dtype=torch.float16,
    device_map="auto",
    trust_remote_code=True,
)
inputs = tokenizer.encode(prompt, return_tensors="pt")
outputs = model.generate(
    input_ids=inputs.to(model.device),
    max_new_tokens=64,
    do_sample=False,
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

```

### Note

Model may sometimes make errors, produce misleading contents, or struggle to manage tasks that are not related to coding. It has undergone very limited testing. Additional safety testing should be performed before any real-world deployments.
