You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We follow [WizardCoder](https://github.com/nlpxucan/WizardLM/blob/main/demo/wizardLM_demo.py) and provide the script to build a local demo server with [gradio](https://www.gradio.app). Refer to [/demo](demo/README.md) for more information.
128
128
129
+
Here are some interesting examples showing **Magicoder**'s improvements over base models:
We create the following two examples by making two original HumanEval problems more complicated. While both **Magicoder-*S*-DS-6.7B** and **deepseek-coder-6.7b-base**, which is **Magicoder**'s base model, can solve the original HumanEval problem, only our **Magicoder-*S*-DS-6.7B** can solve the new complicated problems.
135
+
136
+
### Example 1
137
+
Original Problem:
138
+
```
139
+
Write a function to, given list of integers, return list in "strange" order. "Strange" sorting, is when you start with the minimum value, then maximum of the remaining integers, then minimum and so on.
140
+
```
141
+
142
+
New Problem:
143
+
```
144
+
Write a function to, given list of integers, return list in "ascending" order. "Ascending" sorting, is when you start with the minimum value, then maximum of the remaining integers, then minimum and so on.
145
+
```
146
+
147
+
This problem is challenging because we change the name of a new way (not ascending) to sort integers from "strange" to "ascending". The model should understand that the word "ascending" here has a new meaning based on both the context and the fact that it is surrounded by quotation marks. As is shown in the following responses to the new problem from two models, **Magicoder-*S*-DS-6.7B** successfully understands this complicated requirement, while **deepseek-coder-6.7b-base** is misled and sort integers in ascending order instead.
148
+
149
+
Response to New Problem:
150
+
```python
151
+
# Magicoder-S-DS-6.7B (Correct)
152
+
defascending_sort(lst):
153
+
sorted_lst = []
154
+
while lst:
155
+
min_val =min(lst)
156
+
sorted_lst.append(min_val)
157
+
lst.remove(min_val)
158
+
if lst:
159
+
max_val =max(lst)
160
+
sorted_lst.append(max_val)
161
+
lst.remove(max_val)
162
+
return sorted_lst
163
+
164
+
# deepseek-coder-6.7b-base (Wrong)
165
+
defsort_ascending(lst):
166
+
lst.sort()
167
+
return lst
168
+
```
169
+
170
+
### Example 2
171
+
Original Problem:
172
+
```
173
+
Write a function that takes an integer a and returns True if this ingeger is a cube of some integer number. Note: you may assume the input is always valid.
174
+
```
175
+
176
+
New Problem:
177
+
```
178
+
Write a function that takes an integer a and returns True if this ingeger is a cube of some integer number. Note: you should check whether the input is valid.
179
+
```
180
+
181
+
This problem is challenging because we ask the model to check the inputs' validity rather than assuming the input is always valid. While **Magicoder-*S*-DS-6.7B** successfully check the validity of the input, **deepseek-coder-6.7b-base** wrongly sets `a < 0` as the criterion of invalidity and thus fails to solve the problem.
182
+
183
+
Response to New Problem:
184
+
```python
185
+
# Magicoder-S-DS-6.7B (Correct)
186
+
defis_cube(a):
187
+
ifnotisinstance(a, int):
188
+
returnFalse
189
+
if a <0:
190
+
a =-a
191
+
returnround(a ** (1. /3)) **3== a
192
+
193
+
# deepseek-coder-6.7b-base (Wrong)
194
+
defis_cube(a):
195
+
if a <0:
196
+
returnFalse
197
+
else:
198
+
for i inrange(1, a):
199
+
if i**3== a:
200
+
returnTrue
201
+
returnFalse
202
+
```
203
+
204
+
</details>
205
+
206
+
207
+
208
+
<details>
209
+
<summary> <strong> Magicoder's Ability to Use External Libraries </strong> </summary>
210
+
211
+
We create the following example that requires models to use external libraries for the certain task. While our **Magicoder-*S*-DS-6.7B** successfully follow the instruction in the example, both **deepseek-coder-6.7b-base** and **deepseek-coder-6.7b-instruct** tend to miss some requirements in the instruction.
212
+
213
+
Prompt:
214
+
```
215
+
Write a gradio application for the following use case: Take an input image and return a 45 degree clockwise rotated image. You should also add text description under the output showing the rotation degree.
216
+
```
217
+
218
+
This instruction is challenging because our **Magicoder**'s training dataset does not contain the library "gradio" that is necessary for this task. Here are the gradio applications that **Magicoder-*S*-DS-6.7B**, **deepseek-coder-6.7b-instruct**, and **deepseek-coder-6.7b-base** construct respectively:
219
+
220
+
**Magicoder-*S*-DS-6.7B**: **Correct!**
221
+

222
+
**Magicoder-*S*-DS-6.7B** successfully performs the 45-degree rotation on the input image in the **clockwise** direction. As required in the instruction, it **adds the text description** under the output.
**Deepseek-coder-6.7b-instruct** wrongly performs the 45-degree rotation on the input image in the **counterclockwise** direction. It also **adds the text description** under the output.
**Deepseek-coder-6.7b-base** also wrongly performs the 45-degree rotation on the input image in the **counterclockwise** direction. Even worse, it **misses the text description** under the output.
0 commit comments