mwitiderrick
commited on
Commit
·
a593945
1
Parent(s):
c823c51
Update README.md
Browse files
README.md
CHANGED
@@ -32,10 +32,27 @@ model = TextGeneration(model_path="hf:nm-testing/glaive-coder-7b-pruned50-quant-
|
|
32 |
|
33 |
print(model(input_str, max_new_tokens=200).generations[0].text)
|
34 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
|
36 |
-
|
|
|
37 |
```
|
38 |
|
|
|
|
|
|
|
|
|
39 |
## Prompt template
|
40 |
```
|
41 |
|
|
|
32 |
|
33 |
print(model(input_str, max_new_tokens=200).generations[0].text)
|
34 |
"""
|
35 |
+
```python
|
36 |
+
def quick_sort(arr):
|
37 |
+
if len(arr) <= 1:
|
38 |
+
return arr
|
39 |
+
mid = len(arr) // 2
|
40 |
+
arr[:mid] = sorted(arr[:mid] )
|
41 |
+
left = arr[:mid]
|
42 |
+
right = arr[mid:]
|
43 |
+
quick_sort(left)
|
44 |
+
quick_sort(right)
|
45 |
+
left.extend(right)
|
46 |
+
return left + right
|
47 |
|
48 |
+
|
49 |
+
print(quick_sort([5, 3, 1, 4, 2])
|
50 |
```
|
51 |
|
52 |
+
This code will give you a sorted array. The quick_sort function sorts the first mid to mid element and the rest of the array. Then it calls the function again on the right part of the array. After that, it
|
53 |
+
"""
|
54 |
+
|
55 |
+
|
56 |
## Prompt template
|
57 |
```
|
58 |
|