File size: 2,341 Bytes
b78f071
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
180e978
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
---
license: apache-2.0
tags:
- merge
- mergekit
- lazymergekit
- akameswa/mistral-7b-instruct-javascript-16bit
- akameswa/mistral-7b-instruct-python-16bit
- akameswa/mistral-7b-instruct-java-16bit
- akameswa/mistral-7b-instruct-javascript-16bit
---

# mistral-7b-instruct-code-ties

mistral-7b-instruct-code-ties is a merge of the following models using [mergekit](https://github.com/cg123/mergekit):
* [akameswa/mistral-7b-instruct-javascript-16bit](https://huggingface.co/akameswa/mistral-7b-instruct-javascript-16bit)
* [akameswa/mistral-7b-instruct-python-16bit](https://huggingface.co/akameswa/mistral-7b-instruct-python-16bit)
* [akameswa/mistral-7b-instruct-java-16bit](https://huggingface.co/akameswa/mistral-7b-instruct-java-16bit)
* [akameswa/mistral-7b-instruct-javascript-16bit](https://huggingface.co/akameswa/mistral-7b-instruct-javascript-16bit)

## 🧩 Configuration

```yaml
models:
  - model: akameswa/mistral-7b-instruct-v0.2-bnb-16bit
  - model: akameswa/mistral-7b-instruct-javascript-16bit
    parameters:
      density: 0.85
      weight: 0.25
  - model: akameswa/mistral-7b-instruct-python-16bit
    parameters:
      density: 0.85
      weight: 0.25
  - model: akameswa/mistral-7b-instruct-java-16bit
    parameters:
      density: 0.85
      weight: 0.25
  - model: akameswa/mistral-7b-instruct-javascript-16bit
    parameters:
      density: 0.85
      weight: 0.25
merge_method: ties
base_model: akameswa/mistral-7b-instruct-v0.2-bnb-16bit
parameters:
  normalize: true
dtype: float16
```

## Inference
```python
from unsloth import FastLanguageModel
import torch

model, tokenizer = FastLanguageModel.from_pretrained(
    model_name = "akameswa/mistral-7b-instruct-code-ties",
    max_seq_length = 2048,
)

xlcost_prompt = """Below is a description of a programming task. Write a response that appropriately completes the task based on the given description.

### Description:
{}

### Code:
{}"""

FastLanguageModel.for_inference(model)
inputs = tokenizer(
[
    xlcost_prompt.format(
        "Continue the fibonnaci sequence.",
        "",
    )
], return_tensors = "pt").to("cuda")

outputs = model.generate(**inputs, max_new_tokens = 64, use_cache = True)
tokenizer.batch_decode(outputs)
```

* [Link to inference notebook](https://github.com/akameswa/CodeGenerationMoE/blob/main/code/inference_merge.ipynb)