File size: 2,370 Bytes
bd11bc2
 
 
 
 
 
 
 
 
 
fbb81f4
bd11bc2
fbb81f4
 
 
 
 
bd11bc2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fbb81f4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b1f74ba
fbb81f4
 
 
 
 
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
---
base_model:
- Kukedlc/NeuralSirKrishna-7b
- Kukedlc/NeuralArjuna-7B-DT
- Kukedlc/NeuralMaths-Experiment-7b
- Kukedlc/NeuralSynthesis-7B-v0.1
library_name: transformers
tags:
- mergekit
- merge
license: apache-2.0
---

# NeuralStockFusion-7b

![image/webp](https://cdn-uploads.huggingface.co/production/uploads/64d71ab4089bc502ceb44d29/5Ex2YG8H1oLXaS25gvZQs.webp)

# merge

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 [Model Stock](https://arxiv.org/abs/2403.19522) merge method using [Kukedlc/NeuralSirKrishna-7b](https://huggingface.co/Kukedlc/NeuralSirKrishna-7b) as a base.

### Models Merged

The following models were included in the merge:
* [Kukedlc/NeuralArjuna-7B-DT](https://huggingface.co/Kukedlc/NeuralArjuna-7B-DT)
* [Kukedlc/NeuralMaths-Experiment-7b](https://huggingface.co/Kukedlc/NeuralMaths-Experiment-7b)
* [Kukedlc/NeuralSynthesis-7B-v0.1](https://huggingface.co/Kukedlc/NeuralSynthesis-7B-v0.1)

### Configuration

The following YAML configuration was used to produce this model:

```yaml
models:
  - model: Kukedlc/NeuralMaths-Experiment-7b
  - model: Kukedlc/NeuralArjuna-7B-DT
  - model: Kukedlc/NeuralSirKrishna-7b
  - model: Kukedlc/NeuralSynthesis-7B-v0.1
merge_method: model_stock
base_model: Kukedlc/NeuralSirKrishna-7b
dtype: bfloat16

```

# Model Inference: 

``` python
!pip install -qU transformers accelerate bitsandbytes

from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer, BitsAndBytesConfig
import torch

bnb_config = BitsAndBytesConfig(
    load_in_4bit=True,
    bnb_4bit_use_double_quant=True,
    bnb_4bit_quant_type="nf4",
    bnb_4bit_compute_dtype=torch.bfloat16
)

MODEL_NAME = 'Kukedlc/NeuralStockFusion-7b'
tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME)
model = AutoModelForCausalLM.from_pretrained(MODEL_NAME, device_map='cuda:0', quantization_config=bnb_config)

inputs = tokenizer(["[INST] What is a large language model, in spanish \n[/INST]\n"], return_tensors="pt").to('cuda')
streamer = TextStreamer(tokenizer)

# Despite returning the usual output, the streamer will also print the generated text to stdout.
_ = model.generate(**inputs, streamer=streamer, max_new_tokens=256, do_sample=True, temperature=0.7, repetition_penalty=1.4, top_p=0.9)
```