Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
```python
|
2 |
+
from deepsparse import TextGeneration
|
3 |
+
model = TextGeneration(model="hf:mgoin/deepseek-coder-1.3b-instruct-ds")
|
4 |
+
print(model("#write a quick sort algorithm in python", max_new_tokens=200).generations[0].text)
|
5 |
+
|
6 |
+
"""
|
7 |
+
def quick_sort(arr):
|
8 |
+
if len(arr) <= 1:
|
9 |
+
return arr
|
10 |
+
else:
|
11 |
+
pivot = arr[len(arr) // 2]
|
12 |
+
left = [x for x in arr if x < pivot]
|
13 |
+
middle = [x for x in arr if x == pivot]
|
14 |
+
right = [x for x in arr if x > pivot]
|
15 |
+
return quick_sort(left) + middle + quick_sort(right)
|
16 |
+
|
17 |
+
print(quick_sort([3,6,8,10,1,2,1]))
|
18 |
+
#output: [1, 1, 2, 3, 6, 8, 10]
|
19 |
+
|
20 |
+
#This is a simple implementation of the Quick Sort algorithm in Python. It works by selecting a 'pivot' element from the array and partitioning the other elements into two sub-arrays
|
21 |
+
"""
|
22 |
+
```
|