Spaces:
Runtime error
Runtime error
Commit
·
72e23af
1
Parent(s):
0e84598
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,9 +6,9 @@ models=[
|
|
| 6 |
"nadiamaqbool81/starcoderbase-1b-hf_python",
|
| 7 |
]
|
| 8 |
model_box=[
|
| 9 |
-
gr.
|
| 10 |
-
gr.
|
| 11 |
-
gr.
|
| 12 |
]
|
| 13 |
current_model=model_box[0]
|
| 14 |
|
|
@@ -17,16 +17,10 @@ def the_process(input_text, model_choice):
|
|
| 17 |
output = a_variable(input_text)
|
| 18 |
return(output)
|
| 19 |
|
| 20 |
-
|
| 21 |
-
gr.
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
model_choice = gr.Dropdown(label="Select Model", choices=[m for m in models], type="index", interactive=True)
|
| 25 |
-
input_text = gr.Textbox(label="Input Prompt")
|
| 26 |
-
the_button = gr.Button()
|
| 27 |
-
with gr.Column():
|
| 28 |
-
output_window = gr.Code(label="Generated Code")
|
| 29 |
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
demo.launch()
|
|
|
|
| 6 |
"nadiamaqbool81/starcoderbase-1b-hf_python",
|
| 7 |
]
|
| 8 |
model_box=[
|
| 9 |
+
gr.load(f"models/{models[0]}"),
|
| 10 |
+
gr.load(f"models/{models[1]}"),
|
| 11 |
+
gr.load(f"models/{models[2]}"),
|
| 12 |
]
|
| 13 |
current_model=model_box[0]
|
| 14 |
|
|
|
|
| 17 |
output = a_variable(input_text)
|
| 18 |
return(output)
|
| 19 |
|
| 20 |
+
gr.HTML("""<h1 style="font-weight:600;font-size:50;margin-top:4px;margin-bottom:4px;text-align:center;">Text to Code Generation</h1></div>""")
|
| 21 |
+
model_choice = gr.Dropdown(label="Select Model", choices=[m for m in models], type="index", interactive=True)
|
| 22 |
+
input_text = gr.Textbox(label="Input Prompt")
|
| 23 |
+
output_window = gr.Textbox(label="Generated Code")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
+
interface = gr.Interface(fn=the_process, inputs=[input_text, model_choice], outputs="text")
|
| 26 |
+
interface.launch()
|
|
|