afrideva commited on
Commit
3d6a79e
1 Parent(s): eb367fc

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +84 -0
README.md ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: mesolitica/malaysian-mistral-1.1B-4096
3
+ inference: false
4
+ language:
5
+ - ms
6
+ model_creator: mesolitica
7
+ model_name: malaysian-mistral-1.1B-4096
8
+ pipeline_tag: text-generation
9
+ quantized_by: afrideva
10
+ tags:
11
+ - gguf
12
+ - ggml
13
+ - quantized
14
+ - q2_k
15
+ - q3_k_m
16
+ - q4_k_m
17
+ - q5_k_m
18
+ - q6_k
19
+ - q8_0
20
+ ---
21
+ # mesolitica/malaysian-mistral-1.1B-4096-GGUF
22
+
23
+ Quantized GGUF model files for [malaysian-mistral-1.1B-4096](https://huggingface.co/mesolitica/malaysian-mistral-1.1B-4096) from [mesolitica](https://huggingface.co/mesolitica)
24
+
25
+
26
+ | Name | Quant method | Size |
27
+ | ---- | ---- | ---- |
28
+ | [malaysian-mistral-1.1b-4096.fp16.gguf](https://huggingface.co/afrideva/malaysian-mistral-1.1B-4096-GGUF/resolve/main/malaysian-mistral-1.1b-4096.fp16.gguf) | fp16 | 2.25 GB |
29
+ | [malaysian-mistral-1.1b-4096.q2_k.gguf](https://huggingface.co/afrideva/malaysian-mistral-1.1B-4096-GGUF/resolve/main/malaysian-mistral-1.1b-4096.q2_k.gguf) | q2_k | 491.42 MB |
30
+ | [malaysian-mistral-1.1b-4096.q3_k_m.gguf](https://huggingface.co/afrideva/malaysian-mistral-1.1B-4096-GGUF/resolve/main/malaysian-mistral-1.1b-4096.q3_k_m.gguf) | q3_k_m | 561.96 MB |
31
+ | [malaysian-mistral-1.1b-4096.q4_k_m.gguf](https://huggingface.co/afrideva/malaysian-mistral-1.1B-4096-GGUF/resolve/main/malaysian-mistral-1.1b-4096.q4_k_m.gguf) | q4_k_m | 682.68 MB |
32
+ | [malaysian-mistral-1.1b-4096.q5_k_m.gguf](https://huggingface.co/afrideva/malaysian-mistral-1.1B-4096-GGUF/resolve/main/malaysian-mistral-1.1b-4096.q5_k_m.gguf) | q5_k_m | 799.13 MB |
33
+ | [malaysian-mistral-1.1b-4096.q6_k.gguf](https://huggingface.co/afrideva/malaysian-mistral-1.1B-4096-GGUF/resolve/main/malaysian-mistral-1.1b-4096.q6_k.gguf) | q6_k | 922.87 MB |
34
+ | [malaysian-mistral-1.1b-4096.q8_0.gguf](https://huggingface.co/afrideva/malaysian-mistral-1.1B-4096-GGUF/resolve/main/malaysian-mistral-1.1b-4096.q8_0.gguf) | q8_0 | 1.19 GB |
35
+
36
+
37
+
38
+ ## Original Model Card:
39
+ # Pretrain 1.1B 4096 context length Mistral on Malaysian text
40
+
41
+ README at https://github.com/mesolitica/malaya/tree/5.1/pretrained-model/mistral
42
+
43
+ - Dataset gathered at https://github.com/malaysia-ai/dedup-text-dataset/tree/main/pretrain-llm
44
+ - We use Ray cluster to train on 5 nodes of 4x A100 80GB, https://github.com/malaysia-ai/jupyter-gpu/tree/main/ray
45
+
46
+ WandB, https://wandb.ai/mesolitica/pretrain-mistral-1.1b?workspace=user-husein-mesolitica
47
+
48
+ WandB report, https://wandb.ai/mesolitica/pretrain-mistral-3b/reports/Pretrain-Larger-Malaysian-Mistral--Vmlldzo2MDkyOTgz
49
+
50
+ ## how-to
51
+
52
+ ```python
53
+ from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
54
+ import torch
55
+
56
+ TORCH_DTYPE = 'bfloat16'
57
+ nf4_config = BitsAndBytesConfig(
58
+ load_in_4bit=True,
59
+ bnb_4bit_quant_type='nf4',
60
+ bnb_4bit_use_double_quant=True,
61
+ bnb_4bit_compute_dtype=getattr(torch, TORCH_DTYPE)
62
+ )
63
+
64
+ tokenizer = AutoTokenizer.from_pretrained('mesolitica/malaysian-mistral-1.1B-4096', model_input_names = ['input_ids'])
65
+ model = AutoModelForCausalLM.from_pretrained(
66
+ 'mesolitica/malaysian-mistral-1.1B-4096',
67
+ use_flash_attention_2 = True,
68
+ quantization_config = nf4_config
69
+ )
70
+ prompt = '<s>nama saya'
71
+ inputs = tokenizer([prompt], return_tensors='pt', add_special_tokens=False).to('cuda')
72
+
73
+ generate_kwargs = dict(
74
+ inputs,
75
+ max_new_tokens=512,
76
+ top_p=0.95,
77
+ top_k=50,
78
+ temperature=0.9,
79
+ do_sample=True,
80
+ num_beams=1,
81
+ repetition_penalty=1.05,
82
+ )
83
+ r = model.generate(**generate_kwargs)
84
+ ```