mgbam commited on
Commit
ae77a8f
Β·
verified Β·
1 Parent(s): 20ee71d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -11
app.py CHANGED
@@ -55,7 +55,7 @@ def demo_card_click(evt: gr.EventData):
55
  with gr.Blocks(
56
  theme=gr.themes.Base(
57
  primary_hue="blue",
58
- secondary_hue="gray",
59
  neutral_hue="gray",
60
  font=gr.themes.GoogleFont("Inter"),
61
  font_mono=gr.themes.GoogleFont("JetBrains Mono"),
@@ -63,7 +63,8 @@ with gr.Blocks(
63
  spacing_size=gr.themes.sizes.spacing_md,
64
  radius_size=gr.themes.sizes.radius_md
65
  ),
66
- title="AnyCoder - AI Code Generator"
 
67
  ) as demo:
68
  gr.HTML("<h1 align='center'>AnyCoder - AI Code Generator</h1>")
69
  history = gr.State([])
@@ -76,7 +77,7 @@ with gr.Blocks(
76
 
77
  with gr.Row():
78
  with gr.Column(scale=1):
79
- gr.Markdown("## Controls")
80
  input = gr.Textbox(
81
  label="What would you like to build?",
82
  placeholder="Describe your application...",
@@ -109,12 +110,12 @@ with gr.Blocks(
109
  btn = gr.Button("Generate", variant="primary", size="lg", scale=2, interactive=False)
110
  clear_btn = gr.Button("Clear", variant="secondary", size="sm", scale=1)
111
 
112
- gr.Markdown("---")
113
- gr.Markdown("### Quick Examples")
114
  quick_examples_col = create_top_demo_cards(input)
115
 
116
- gr.Markdown("---")
117
- gr.Markdown("### Settings")
118
  search_toggle = gr.Checkbox(
119
  label="πŸ” Web search",
120
  value=False,
@@ -172,10 +173,8 @@ with gr.Blocks(
172
 
173
  async def submit_query(*args):
174
  """Handles the main code generation logic asynchronously."""
175
- # This is the correct way to handle async generators in Gradio
176
- with gr.Tabs():
177
- async for update in generation_code(*args):
178
- yield update
179
 
180
  btn.click(fn=submit_query,
181
  inputs=[input, image_input, file_input, website_url_input, setting, history, current_model, search_toggle, language_dropdown],
 
55
  with gr.Blocks(
56
  theme=gr.themes.Base(
57
  primary_hue="blue",
58
+ secondary_hue="blue",
59
  neutral_hue="gray",
60
  font=gr.themes.GoogleFont("Inter"),
61
  font_mono=gr.themes.GoogleFont("JetBrains Mono"),
 
63
  spacing_size=gr.themes.sizes.spacing_md,
64
  radius_size=gr.themes.sizes.radius_md
65
  ),
66
+ title="AnyCoder - AI Code Generator",
67
+ css="style.css" # Load the custom CSS
68
  ) as demo:
69
  gr.HTML("<h1 align='center'>AnyCoder - AI Code Generator</h1>")
70
  history = gr.State([])
 
77
 
78
  with gr.Row():
79
  with gr.Column(scale=1):
80
+ gr.Markdown("## Controls", elem_classes=["col-header"])
81
  input = gr.Textbox(
82
  label="What would you like to build?",
83
  placeholder="Describe your application...",
 
110
  btn = gr.Button("Generate", variant="primary", size="lg", scale=2, interactive=False)
111
  clear_btn = gr.Button("Clear", variant="secondary", size="sm", scale=1)
112
 
113
+ gr.Markdown("---",)
114
+ gr.Markdown("### Quick Examples", elem_classes=["col-header"])
115
  quick_examples_col = create_top_demo_cards(input)
116
 
117
+ gr.Markdown("---",)
118
+ gr.Markdown("### Settings", elem_classes=["col-header"])
119
  search_toggle = gr.Checkbox(
120
  label="πŸ” Web search",
121
  value=False,
 
173
 
174
  async def submit_query(*args):
175
  """Handles the main code generation logic asynchronously."""
176
+ async for update in generation_code(*args):
177
+ yield update
 
 
178
 
179
  btn.click(fn=submit_query,
180
  inputs=[input, image_input, file_input, website_url_input, setting, history, current_model, search_toggle, language_dropdown],