File size: 2,071 Bytes
a8fc527
2413900
 
 
 
 
 
 
 
 
a8fc527
2413900
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0640b7a
 
 
d821422
0640b7a
 
5d4306e
0640b7a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74a1749
090404d
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
---
base_model:
- deepseek-ai/deepseek-coder-6.7b-instruct
- m-a-p/OpenCodeInterpreter-DS-6.7B
- deepseek-ai/deepseek-coder-6.7b-base
library_name: transformers
tags:
- mergekit
- merge

---
# output-model-directory

This is a merge of pre-trained language models created using [mergekit](https://github.com/cg123/mergekit).

## Merge Details
### Merge Method

This model was merged using the [TIES](https://arxiv.org/abs/2306.01708) merge method using [deepseek-ai/deepseek-coder-6.7b-base](https://huggingface.co/deepseek-ai/deepseek-coder-6.7b-base) as a base.

### Models Merged

The following models were included in the merge:
* [deepseek-ai/deepseek-coder-6.7b-instruct](https://huggingface.co/deepseek-ai/deepseek-coder-6.7b-instruct)
* [m-a-p/OpenCodeInterpreter-DS-6.7B](https://huggingface.co/m-a-p/OpenCodeInterpreter-DS-6.7B)

### Configuration

The following YAML configuration was used to produce this model:

```yaml
models:
  - model: deepseek-ai/deepseek-coder-6.7b-instruct
    parameters:
      density: [1, 0.7, 0.1] # density gradient
      weight: 1.0
  - model: m-a-p/OpenCodeInterpreter-DS-6.7B
    parameters:
      density: 0.5
      weight: [0, 0.3, 0.7, 1] # weight gradient
merge_method: ties
base_model: deepseek-ai/deepseek-coder-6.7b-base
parameters:
  normalize: true
  int8_mask: true
dtype: float16

```

### How to Use

```python
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
tokenizer = AutoTokenizer.from_pretrained("ori-cloud/ds-trinity-7b-v1")
model = AutoModelForCausalLM.from_pretrained("ori-cloud/ds-trinity-7b-v1", torch_dtype=torch.bfloat16,
    device_map="auto")
prompt = "#write a quick sort algorithm"
inputs = tokenizer.apply_chat_template(
        [{'role': 'user', 'content': prompt }],
        return_tensors="pt"
    ).to(model.device)
outputs = model.generate(
    inputs, 
    max_new_tokens=1024,
    do_sample=False,
    pad_token_id=tokenizer.eos_token_id,
    eos_token_id=tokenizer.eos_token_id,
)
print(tokenizer.decode(outputs[0][len(inputs[0]):], skip_special_tokens=True))

```