Update app.py
Browse files
app.py
CHANGED
@@ -9,6 +9,8 @@ from gradio.data_classes import FileData
|
|
9 |
|
10 |
# Fetch an environment variable.
|
11 |
GG_API_KEY = os.environ.get('GG_API_KEY')
|
|
|
|
|
12 |
genai.configure(api_key=GG_API_KEY)
|
13 |
|
14 |
model = genai.GenerativeModel('gemini-pro')
|
@@ -64,7 +66,7 @@ with gr.Blocks() as demo:
|
|
64 |
gr.HTML("<center><h1>Tomoniai's Gemini-PRO Chat</h1></center>")
|
65 |
|
66 |
# Initialize the MultimodalChatbot component
|
67 |
-
multi = MultimodalChatbot(value=[], height=
|
68 |
|
69 |
with gr.Row():
|
70 |
# Textbox for user input with increased scale for better visibility
|
@@ -82,5 +84,4 @@ with gr.Blocks() as demo:
|
|
82 |
.then(lambda: gr.UploadButton("Image Uploaded"), [], up) \
|
83 |
.then(lambda: gr.UploadButton("Upload Image"), [], up)
|
84 |
|
85 |
-
|
86 |
-
demo.queue().launch()
|
|
|
9 |
|
10 |
# Fetch an environment variable.
|
11 |
GG_API_KEY = os.environ.get('GG_API_KEY')
|
12 |
+
oaiusr = os.environ.get("OAI_USR")
|
13 |
+
oaipwd = os.environ.get("OAI_PWD")
|
14 |
genai.configure(api_key=GG_API_KEY)
|
15 |
|
16 |
model = genai.GenerativeModel('gemini-pro')
|
|
|
66 |
gr.HTML("<center><h1>Tomoniai's Gemini-PRO Chat</h1></center>")
|
67 |
|
68 |
# Initialize the MultimodalChatbot component
|
69 |
+
multi = MultimodalChatbot(value=[], height=500)
|
70 |
|
71 |
with gr.Row():
|
72 |
# Textbox for user input with increased scale for better visibility
|
|
|
84 |
.then(lambda: gr.UploadButton("Image Uploaded"), [], up) \
|
85 |
.then(lambda: gr.UploadButton("Upload Image"), [], up)
|
86 |
|
87 |
+
demo.queue().launch(auth=(oaiusr, oaipwd),show_api=False)
|
|