nadiamaqbool81 commited on
Commit
6a93f34
·
1 Parent(s): 00af017

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -3,12 +3,14 @@ import gradio as gr
3
  models=[
4
  "nadiamaqbool81/starcoderbase-1b-hf",
5
  "nadiamaqbool81/starcoderbase-1b-hf_python",
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
 
@@ -20,7 +22,7 @@ def the_process(input_text, model_choice):
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()
 
3
  models=[
4
  "nadiamaqbool81/starcoderbase-1b-hf",
5
  "nadiamaqbool81/starcoderbase-1b-hf_python",
6
+ "nadiamaqbool81/codet5-large-hf",
7
+ "nadiamaqbool81/codet5-large-hf-python",
8
  ]
9
  model_box=[
10
  gr.load(f"models/{models[0]}"),
11
  gr.load(f"models/{models[1]}"),
12
  gr.load(f"models/{models[2]}"),
13
+ gr.load(f"models/{models[3]}"),
14
  ]
15
  current_model=model_box[0]
16
 
 
22
  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>""")
23
  model_choice = gr.Dropdown(label="Select Model", choices=[m for m in models], type="index", interactive=True)
24
  input_text = gr.Textbox(label="Input Prompt")
25
+ output_window = gr.Code(label="Generated Code")
26
 
27
  interface = gr.Interface(fn=the_process, inputs=[input_text, model_choice], outputs="text")
28
  interface.launch()