Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,8 +2,9 @@ import os
|
|
2 |
import google.generativeai as genai
|
3 |
import gradio as gr
|
4 |
|
5 |
-
# Configure the
|
6 |
-
|
|
|
7 |
|
8 |
# Set up the generation configuration
|
9 |
generation_config = {
|
@@ -33,15 +34,15 @@ def generate_response(user_input):
|
|
33 |
return response.text
|
34 |
|
35 |
# Gradio Interface
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
generate_button.click(generate_response, inputs=user_input, outputs=output_text)
|
45 |
|
46 |
# Launch the Gradio app
|
47 |
-
|
|
|
|
2 |
import google.generativeai as genai
|
3 |
import gradio as gr
|
4 |
|
5 |
+
# Configure the API key for Google Generative AI
|
6 |
+
GOOGLE_API_KEY = "AIzaSyA9Bh3WRz6LzKaA7MDm6foj1dw8w8kh-gc"
|
7 |
+
genai.configure(api_key=GOOGLE_API_KEY)
|
8 |
|
9 |
# Set up the generation configuration
|
10 |
generation_config = {
|
|
|
34 |
return response.text
|
35 |
|
36 |
# Gradio Interface
|
37 |
+
iface = gr.Interface(
|
38 |
+
fn=generate_response,
|
39 |
+
inputs="text",
|
40 |
+
outputs="text",
|
41 |
+
title="Recipe Generator",
|
42 |
+
description="Ask for recipes or any other text-based generation using Google's Gemini AI",
|
43 |
+
theme="default",
|
44 |
+
)
|
|
|
45 |
|
46 |
# Launch the Gradio app
|
47 |
+
if __name__ == "__main__":
|
48 |
+
iface.launch()
|