Skip to content

Commit aada5f1

Browse files
update demo
1 parent 75610ff commit aada5f1

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -171,3 +171,4 @@ cython_debug/
171171
# Demo file
172172
flagged/
173173
*.sh
174+
logs/

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
| Magicoder-CL-7B | 🤗 [HF Link](https://huggingface.co/ise-uiuc/Magicoder-CL-7B) | 7B | 60.4 (55.5) | 64.2 (52.6) | -- | [Llama2](https://ai.meta.com/llama/license/) |
3333
| Magicoder-*S*-CL-7B | 🤗 [HF Link](https://huggingface.co/ise-uiuc/Magicoder-S-CL-7B) | 7B | 70.7 (66.5) | 68.4 (56.6) | -- | [Llama2](https://ai.meta.com/llama/license/) |
3434
| Magicoder-DS-6.7B | 🤗 [HF Link](https://huggingface.co/ise-uiuc/Magicoder-DS-6.7B) | 6.7B | 66.5 (60.4) | 75.4 (61.9) | -- | [DeepSeek](https://github.com/deepseek-ai/DeepSeek-Coder/blob/main/LICENSE-MODEL) |
35-
| Magicoder-*S*-DS-6.7B | 🤗 [HF Link](https://huggingface.co/ise-uiuc/Magicoder-S-DS-6.7B) | 6.7B | **76.8** (**70.7**) | **75.7** (**64.4**) | [Demo](https://eee43889442b801df4.gradio.live/)* | [DeepSeek](https://github.com/deepseek-ai/DeepSeek-Coder/blob/main/LICENSE-MODEL) |
35+
| Magicoder-*S*-DS-6.7B | 🤗 [HF Link](https://huggingface.co/ise-uiuc/Magicoder-S-DS-6.7B) | 6.7B | **76.8** (**70.7**) | **75.7** (**64.4**) | [Demo](https://67cc8c194b67d37b94.gradio.live)* | [DeepSeek](https://github.com/deepseek-ai/DeepSeek-Coder/blob/main/LICENSE-MODEL) |
3636

3737
<sub>*Demo link will expire on 12/8/2023.</sub>
3838

demo/magicoder_demo.py

+14-7
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,18 @@ def evaluate_magicoder(
3333
"""
3434
prompt = MAGICODER_PROMPT.format(instruction=instruction)
3535

36-
sequences = pipeline(
37-
prompt,
38-
temperature=temperature,
39-
max_new_tokens=max_new_tokens,
40-
)
36+
if temperature > 0:
37+
sequences = pipeline(
38+
prompt,
39+
do_sample=True,
40+
temperature=temperature,
41+
max_new_tokens=max_new_tokens,
42+
)
43+
else:
44+
sequences = pipeline(
45+
prompt,
46+
max_new_tokens=max_new_tokens,
47+
)
4148
for seq in sequences:
4249
print('==========================question=============================')
4350
print(prompt)
@@ -52,9 +59,9 @@ def evaluate_magicoder(
5259
gr.components.Textbox(
5360
lines=3, label="Instruction", placeholder="Anything you want to ask Magicoder ?"
5461
),
55-
gr.components.Slider(minimum=0, maximum=1, value=0, label="Temperature"),
62+
gr.components.Slider(minimum=0, maximum=1, value=1, label="Temperature"),
5663
gr.components.Slider(
57-
minimum=1, maximum=2048, step=1, value=128, label="Max tokens"
64+
minimum=1, maximum=2048, step=1, value=512, label="Max tokens"
5865
),
5966
],
6067
outputs=[

0 commit comments

Comments
 (0)