GGUF
conversational
n1ck-guo commited on
Commit
abd6627
·
verified ·
1 Parent(s): 69b5baa

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +143 -0
README.md ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model:
3
+ - Qwen/Qwen3-Coder-30B-A3B-Instruct
4
+ datasets:
5
+ - codeparrot/github-code-clean
6
+ ---
7
+
8
+ ## Model Details
9
+
10
+ This model is a gguf q4km format of [Qwen/Qwen3-Coder-30B-A3B-Instruct](https://huggingface.co/Qwen/Qwen/Qwen3-Coder-30B-A3B-Instruct) generated by [intel/auto-round](https://github.com/intel/auto-round) algorithm. Embedding layer and lm-head layer are fallback to 8 bits and non expert layers are fallback to 4 bits. Please refer to Section `Generate the model` for more details.
11
+
12
+ Please follow the license of the original model.
13
+
14
+ ## How To Use
15
+
16
+ Llamacpp inference
17
+
18
+ ~~~bash
19
+ /llama-cli -hf Intel/Qwen3-Coder-30B-A3B-Instruct-gguf-q2ks-mixed-AutoRound
20
+ ~~~
21
+
22
+ ~~~bash
23
+ > Write a quick sort algorithm.
24
+ Here's a quick sort algorithm implementation in Python:
25
+
26
+ ```python
27
+ def quicksort(arr, low, high):
28
+ """
29
+ Quick sort implementation
30
+ arr: array to be sorted
31
+ low: starting index
32
+ high: ending index
33
+ """
34
+ if low < high:
35
+ # Partition the array and get pivot index
36
+ pivot_index = partition(arr, low, high)
37
+
38
+ # Recursively sort elements before and after partition
39
+ quicksort(arr, low, pivot_index - 1)
40
+ quicksort(arr, pivot_index + 1, high)
41
+
42
+ def partition(arr, low, high):
43
+ """
44
+ Partition function using last element as pivot
45
+ """
46
+ # Choose the rightmost element as pivot
47
+ pivot = arr[high]
48
+
49
+ # Index of smaller element (indicates right position of pivot)
50
+ i = low - 1
51
+
52
+ for j in range(low, high):
53
+ # If current element is smaller than or equal to pivot
54
+ if arr[j] <= pivot:
55
+ i += 1
56
+ arr[i], arr[j] = arr[j], arr[i] # Swap elements
57
+
58
+ # Place pivot in its correct position
59
+ arr[i + 1], arr[high] = arr[high], arr[i + 1]
60
+ return i + 1
61
+
62
+ # Wrapper function for easier use
63
+ def quick_sort(arr):
64
+ if len(arr) <= 1:
65
+ return arr
66
+ quicksort(arr, 0, len(arr) - 1)
67
+ return arr
68
+
69
+ # Example usage
70
+ if __name__ == "__main__":
71
+ # Test the algorithm
72
+ test_array = [64, 34, 25, 12, 22, 11, 90]
73
+ print("Original array:", test_array)
74
+
75
+ sorted_array = quick_sort(test_array.copy())
76
+ print("Sorted array:", sorted_array)
77
+
78
+ # Test with edge cases
79
+ print("Empty array:", quick_sort([]))
80
+ print("Single element:", quick_sort([42]))
81
+ print("Already sorted:", quick_sort([1, 2, 3, 4, 5]))
82
+ print("Reverse sorted:", quick_sort([5, 4, 3, 2, 1]))
83
+ ```
84
+
85
+ **How it works:**
86
+
87
+ 1. **Choose a pivot**: Select an element from the array (here we use the last element)
88
+ 2. **Partition**: Rearrange the array so that:
89
+ - Elements smaller than the pivot go to the left
90
+ - Elements greater than the pivot go to the right
91
+ 3. **Recursively sort**: Apply the same process to the sub-arrays on both sides of the pivot
92
+
93
+ **Time Complexity:**
94
+ - Best/Average case: O(n log n)
95
+ - Worst case: O(n²) - when pivot is always the smallest or largest element
96
+
97
+ **Space Complexity:** O(log n) - due to recursion stack
98
+
99
+ **Key Features:**
100
+ - In-place sorting (modifies original array)
101
+ - Not stable (doesn't preserve relative order of equal elements)
102
+ - Efficient for large datasets
103
+ - Good average performance
104
+
105
+ The algorithm handles edge cases like empty arrays, single elements, and already sorted arrays.
106
+
107
+ ~~~
108
+
109
+
110
+
111
+ ### Generate the model
112
+
113
+ Here is the sample command to reproduce the model
114
+
115
+ ```bash
116
+ auto_round --format gguf:q4_k_m --iters 0 --nsamples 512 --dataset github-code-clean --model /workspace/Qwen/Qwen3-Coder-30B-A3B-Instruct/ --output_dir tmp_autoround
117
+ ```
118
+
119
+
120
+
121
+ ## Ethical Considerations and Limitations
122
+
123
+ The model can produce factually incorrect output, and should not be relied on to produce factually accurate information. Because of the limitations of the pretrained model and the finetuning datasets, it is possible that this model could generate lewd, biased or otherwise offensive outputs.
124
+
125
+ Therefore, before deploying any applications of the model, developers should perform safety testing.
126
+
127
+ ## Caveats and Recommendations
128
+
129
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model.
130
+
131
+ Here are a couple of useful links to learn more about Intel's AI software:
132
+
133
+ - Intel Neural Compressor [link](https://github.com/intel/neural-compressor)
134
+
135
+ ## Disclaimer
136
+
137
+ The license on this model does not constitute legal advice. We are not responsible for the actions of third parties who use this model. Please consult an attorney before using this model for commercial purposes.
138
+
139
+ ## Cite
140
+
141
+ @article{cheng2023optimize, title={Optimize weight rounding via signed gradient descent for the quantization of llms}, author={Cheng, Wenhua and Zhang, Weiwei and Shen, Haihao and Cai, Yiyang and He, Xin and Lv, Kaokao and Liu, Yi}, journal={arXiv preprint arXiv:2309.05516}, year={2023} }
142
+
143
+ [arxiv](https://arxiv.org/abs/2309.05516) [github](https://github.com/intel/auto-round)