akhaliq HF staff commited on
Commit
b1015d8
·
verified ·
1 Parent(s): 5a2067d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -10
app.py CHANGED
@@ -3,7 +3,7 @@ import google.generativeai as genai
3
  import gradio as gr
4
 
5
  # Configure the API key
6
- genai.configure(api_key=os.environ["YOUR_API_KEY"])
7
 
8
  # Create the model
9
  generation_config = {
@@ -47,12 +47,5 @@ with gr.Blocks() as demo:
47
  user_input = gr.Textbox(
48
  show_label=False,
49
  placeholder="Type your message and press Enter"
50
- ).style(container=False)
51
- send_btn = gr.Button("Send")
52
- send_btn.click(chat_with_model, [user_input, state], [chatbot, state])
53
- user_input.submit(chat_with_model, [user_input, state], [chatbot, state])
54
- # Clear input after sending
55
- send_btn.click(lambda: "", None, user_input)
56
- user_input.submit(lambda: "", None, user_input)
57
-
58
- demo.launch()
 
3
  import gradio as gr
4
 
5
  # Configure the API key
6
+ genai.configure(api_key=os.environ["GEMINI_API_KEY"])
7
 
8
  # Create the model
9
  generation_config = {
 
47
  user_input = gr.Textbox(
48
  show_label=False,
49
  placeholder="Type your message and press Enter"
50
+ )
51
+ send