πŸŒπŸ’ commited on
Commit
fd1d51a
Β·
1 Parent(s): 1d18ebc

Gradio Blocks is not supported anymore, changed

Browse files
Files changed (1) hide show
  1. app.py +11 -12
app.py CHANGED
@@ -56,8 +56,7 @@ def create_gradio_interface():
56
  with gr.Blocks(
57
  title="Devika AI Assistant",
58
  theme=gr.themes.Soft(),
59
- analytics_enabled=False,
60
- cache_examples=False # Disable example caching to avoid permission issues
61
  ) as interface:
62
  gr.Markdown("""
63
  # πŸ€– Devika AI Assistant
@@ -111,17 +110,18 @@ def create_gradio_interface():
111
  with gr.Column(scale=3):
112
  output_box = gr.Markdown(label="Devika's Response")
113
 
114
- # Add examples without caching
 
 
 
 
 
 
115
  gr.Examples(
116
- examples=[
117
- ["Create a React component for a todo list", "gpt-3.5-turbo", "DuckDuckGo"],
118
- ["Help me understand how to use Python decorators", "gpt-3.5-turbo", "DuckDuckGo"],
119
- ["Write a Node.js API endpoint for user authentication", "gpt-3.5-turbo", "DuckDuckGo"]
120
- ],
121
  inputs=[message_input, model_dropdown, search_engine_dropdown],
122
  outputs=output_box,
123
- fn=lambda x, y, z: process_message(x, y, "default", z),
124
- cache_examples=False # Disable example caching
125
  )
126
 
127
  submit_btn.click(
@@ -141,6 +141,5 @@ if __name__ == "__main__":
141
  server_port=7860,
142
  share=False,
143
  debug=False,
144
- show_error=True,
145
- cache_examples=False # Disable example caching
146
  )
 
56
  with gr.Blocks(
57
  title="Devika AI Assistant",
58
  theme=gr.themes.Soft(),
59
+ analytics_enabled=False
 
60
  ) as interface:
61
  gr.Markdown("""
62
  # πŸ€– Devika AI Assistant
 
110
  with gr.Column(scale=3):
111
  output_box = gr.Markdown(label="Devika's Response")
112
 
113
+ # Add examples
114
+ examples = [
115
+ ["Create a React component for a todo list", "gpt-3.5-turbo", "DuckDuckGo"],
116
+ ["Help me understand how to use Python decorators", "gpt-3.5-turbo", "DuckDuckGo"],
117
+ ["Write a Node.js API endpoint for user authentication", "gpt-3.5-turbo", "DuckDuckGo"]
118
+ ]
119
+
120
  gr.Examples(
121
+ examples=examples,
 
 
 
 
122
  inputs=[message_input, model_dropdown, search_engine_dropdown],
123
  outputs=output_box,
124
+ fn=lambda x, y, z: process_message(x, y, "default", z)
 
125
  )
126
 
127
  submit_btn.click(
 
141
  server_port=7860,
142
  share=False,
143
  debug=False,
144
+ show_error=True
 
145
  )