Spaces:
Running
Running
Update app
Browse files
app.py
CHANGED
|
@@ -56,13 +56,22 @@ def main():
|
|
| 56 |
with gr.Blocks() as demo:
|
| 57 |
gr.Markdown(
|
| 58 |
"""# CodeGeeX: A Multilingual Code Generation Model
|
| 59 |
-
<img src="https://
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
We introduce CodeGeeX, a large-scale multilingual code generation model with 13 billion parameters, pre-trained on a large code corpus of more than 20 programming languages. CodeGeeX was trained on more than 850 billion tokens on a cluster of 1,536 [Ascend 910 AI Processors](https://e.huawei.com/en/products/servers/ascend). CodeGeeX supports 15+ programming languages for both code generation and code translation. CodeGeeX is open source, please refer to our [GitHub](https://github.com/THUDM/CodeGeeX) for more details. This is a minimal-functional DEMO, for other DEMOs like code translation, please visit our [Homepage](https://models.aminer.cn/codegeex/). We also offer a free [VS Code extension](https://marketplace.visualstudio.com/items?itemName=aminer.codegeex) for full functionality.
|
| 61 |
""")
|
| 62 |
|
| 63 |
with gr.Row():
|
| 64 |
with gr.Column():
|
| 65 |
-
prompt = gr.Textbox(lines=13, placeholder='
|
| 66 |
with gr.Row():
|
| 67 |
gen = gr.Button("Generate")
|
| 68 |
clr = gr.Button("Clear")
|
|
@@ -81,11 +90,13 @@ def main():
|
|
| 81 |
"SQL", "Kotlin", "R", "Fortran"], value='lang', label='Programming Language',
|
| 82 |
default="Python")
|
| 83 |
with gr.Column():
|
| 84 |
-
seed = gr.Slider(maximum=10000, value=
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
|
|
|
|
|
|
| 89 |
|
| 90 |
inputs = [prompt, lang, seed, out_seq_length, temperature, top_k, top_p]
|
| 91 |
gen.click(fn=predict, inputs=inputs, outputs=outputs)
|
|
@@ -94,7 +105,6 @@ def main():
|
|
| 94 |
gr_examples = gr.Examples(examples=examples, inputs=[prompt, lang],
|
| 95 |
label="Example Inputs (Click to insert an examplet it into the input box)",
|
| 96 |
examples_per_page=20)
|
| 97 |
-
gr.Markdown("")
|
| 98 |
|
| 99 |
demo.launch()
|
| 100 |
|
|
|
|
| 56 |
with gr.Blocks() as demo:
|
| 57 |
gr.Markdown(
|
| 58 |
"""# CodeGeeX: A Multilingual Code Generation Model
|
| 59 |
+
<img src="https://raw.githubusercontent.com/THUDM/CodeGeeX/main/resources/logo/codegeex_logo.png">
|
| 60 |
+
""")
|
| 61 |
+
gr.Markdown(
|
| 62 |
+
"""
|
| 63 |
+
<p align="center">
|
| 64 |
+
π <a href="https://models.aminer.cn/codegeex" target="_blank">Homepage</a> | π <a href="http://keg.cs.tsinghua.edu.cn/codegeex/" target="_blank">Blog</a> | πͺ§ <a href="https://models.aminer.cn/codegeex/playground" target="_blank">DEMO</a> | π <a href="https://marketplace.visualstudio.com/items?itemName=aminer.codegeex" target="_blank">VS Code Extension</a> | π» <a href="https://github.com/THUDM/CodeGeeX" target="_blank">Source code</a> | π€ <a href="https://models.aminer.cn/codegeex/download/request" target="_blank">Download Model</a>
|
| 65 |
+
</p>
|
| 66 |
+
""")
|
| 67 |
+
gr.Markdown(
|
| 68 |
+
"""
|
| 69 |
We introduce CodeGeeX, a large-scale multilingual code generation model with 13 billion parameters, pre-trained on a large code corpus of more than 20 programming languages. CodeGeeX was trained on more than 850 billion tokens on a cluster of 1,536 [Ascend 910 AI Processors](https://e.huawei.com/en/products/servers/ascend). CodeGeeX supports 15+ programming languages for both code generation and code translation. CodeGeeX is open source, please refer to our [GitHub](https://github.com/THUDM/CodeGeeX) for more details. This is a minimal-functional DEMO, for other DEMOs like code translation, please visit our [Homepage](https://models.aminer.cn/codegeex/). We also offer a free [VS Code extension](https://marketplace.visualstudio.com/items?itemName=aminer.codegeex) for full functionality.
|
| 70 |
""")
|
| 71 |
|
| 72 |
with gr.Row():
|
| 73 |
with gr.Column():
|
| 74 |
+
prompt = gr.Textbox(lines=13, placeholder='Please enter the description or select an example input below.',label='Input')
|
| 75 |
with gr.Row():
|
| 76 |
gen = gr.Button("Generate")
|
| 77 |
clr = gr.Button("Clear")
|
|
|
|
| 90 |
"SQL", "Kotlin", "R", "Fortran"], value='lang', label='Programming Language',
|
| 91 |
default="Python")
|
| 92 |
with gr.Column():
|
| 93 |
+
seed = gr.Slider(maximum=10000, value=8888, step=1, label='Seed')
|
| 94 |
+
with gr.Row():
|
| 95 |
+
out_seq_length = gr.Slider(maximum=1024, value=128, minimum=1, step=1, label='Output Sequence Length')
|
| 96 |
+
temperature = gr.Slider(maximum=1, value=0.2, minimum=0, label='Temperature')
|
| 97 |
+
with gr.Row():
|
| 98 |
+
top_k = gr.Slider(maximum=40, value=0, minimum=0, step=1, label='Top K')
|
| 99 |
+
top_p = gr.Slider(maximum=1, value=1.0, minimum=0, label='Top P')
|
| 100 |
|
| 101 |
inputs = [prompt, lang, seed, out_seq_length, temperature, top_k, top_p]
|
| 102 |
gen.click(fn=predict, inputs=inputs, outputs=outputs)
|
|
|
|
| 105 |
gr_examples = gr.Examples(examples=examples, inputs=[prompt, lang],
|
| 106 |
label="Example Inputs (Click to insert an examplet it into the input box)",
|
| 107 |
examples_per_page=20)
|
|
|
|
| 108 |
|
| 109 |
demo.launch()
|
| 110 |
|