Spaces:
Sleeping
Sleeping
prithivMLmods
commited on
Commit
•
6603185
1
Parent(s):
e4f6edf
Update app.py
Browse files
app.py
CHANGED
@@ -4,6 +4,14 @@ import google.generativeai as genai
|
|
4 |
from dotenv import load_dotenv
|
5 |
import time
|
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
load_dotenv()
|
8 |
|
9 |
GEMINI_API_KEY = "AIzaSyBRkv6TCfyZtT5Q6H6ur2W8KSNt9ksbeDI" # Public API key
|
@@ -67,7 +75,7 @@ def generate_response(user_input, chat_history, mood):
|
|
67 |
return f"Error after {retry_attempts} attempts: {str(e)}", chat_history
|
68 |
|
69 |
# Build the Gradio interface
|
70 |
-
with gr.Blocks(theme="bethecloud/storj_theme") as iface:
|
71 |
gr.Markdown("Duplicate this space in case there is an error or something with your own Gemini API key!")
|
72 |
chat_input = gr.Textbox(lines=2, label="Talk to AI", placeholder="Enter your message here...")
|
73 |
chat_history_state = gr.State([]) # State input for chat history
|
|
|
4 |
from dotenv import load_dotenv
|
5 |
import time
|
6 |
|
7 |
+
css = '''
|
8 |
+
.gradio-container{max-width: 950px !important}
|
9 |
+
h1{text-align:center}
|
10 |
+
footer {
|
11 |
+
visibility: hidden
|
12 |
+
}
|
13 |
+
'''
|
14 |
+
|
15 |
load_dotenv()
|
16 |
|
17 |
GEMINI_API_KEY = "AIzaSyBRkv6TCfyZtT5Q6H6ur2W8KSNt9ksbeDI" # Public API key
|
|
|
75 |
return f"Error after {retry_attempts} attempts: {str(e)}", chat_history
|
76 |
|
77 |
# Build the Gradio interface
|
78 |
+
with gr.Blocks(css=css, theme="bethecloud/storj_theme") as iface:
|
79 |
gr.Markdown("Duplicate this space in case there is an error or something with your own Gemini API key!")
|
80 |
chat_input = gr.Textbox(lines=2, label="Talk to AI", placeholder="Enter your message here...")
|
81 |
chat_history_state = gr.State([]) # State input for chat history
|