Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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["
|
| 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 |
-
)
|
| 51 |
-
|
| 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|