Ryouko commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -112,6 +112,22 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
| 112 |
""")
|
| 113 |
|
| 114 |
with gr.Row():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 115 |
with gr.Column(scale=1):
|
| 116 |
api_key = gr.Textbox(label="API Key", type="password", placeholder="Enter your Google AI API key")
|
| 117 |
model = gr.Dropdown(
|
|
@@ -144,22 +160,7 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
| 144 |
sexually_explicit = gr.Dropdown(label="Sexually Explicit", choices=["BLOCK_NONE", "BLOCK_ONLY_HIGH", "BLOCK_MEDIUM_AND_ABOVE", "BLOCK_LOW_AND_ABOVE"], value="BLOCK_MEDIUM_AND_ABOVE")
|
| 145 |
dangerous_content = gr.Dropdown(label="Dangerous Content", choices=["BLOCK_NONE", "BLOCK_ONLY_HIGH", "BLOCK_MEDIUM_AND_ABOVE", "BLOCK_LOW_AND_ABOVE"], value="BLOCK_MEDIUM_AND_ABOVE")
|
| 146 |
|
| 147 |
-
|
| 148 |
-
chatbot = gr.ChatInterface(
|
| 149 |
-
fn=bot_streaming,
|
| 150 |
-
additional_inputs=[
|
| 151 |
-
api_key, model, system_prompt, temperature, max_tokens, top_p, top_k,
|
| 152 |
-
harassment, hate_speech, sexually_explicit, dangerous_content
|
| 153 |
-
],
|
| 154 |
-
title="💬 Chat with Google Gemini AI",
|
| 155 |
-
description="Upload images or type your message to start the conversation.",
|
| 156 |
-
retry_btn="🔄 Retry",
|
| 157 |
-
undo_btn="↩️ Undo",
|
| 158 |
-
clear_btn="🗑️ Clear",
|
| 159 |
-
multimodal=True,
|
| 160 |
-
cache_examples=False,
|
| 161 |
-
fill_height=True,
|
| 162 |
-
)
|
| 163 |
|
| 164 |
gr.Markdown("""
|
| 165 |
## 🔧 Settings:
|
|
|
|
| 112 |
""")
|
| 113 |
|
| 114 |
with gr.Row():
|
| 115 |
+
with gr.Column(scale=2):
|
| 116 |
+
chatbot = gr.ChatInterface(
|
| 117 |
+
fn=bot_streaming,
|
| 118 |
+
additional_inputs=[
|
| 119 |
+
api_key, model, system_prompt, temperature, max_tokens, top_p, top_k,
|
| 120 |
+
harassment, hate_speech, sexually_explicit, dangerous_content
|
| 121 |
+
],
|
| 122 |
+
title="💬 Chat with Google Gemini AI",
|
| 123 |
+
description="Upload images or type your message to start the conversation.",
|
| 124 |
+
retry_btn="🔄 Retry",
|
| 125 |
+
undo_btn="↩️ Undo",
|
| 126 |
+
clear_btn="🗑️ Clear",
|
| 127 |
+
multimodal=True,
|
| 128 |
+
cache_examples=False,
|
| 129 |
+
fill_height=True,
|
| 130 |
+
)
|
| 131 |
with gr.Column(scale=1):
|
| 132 |
api_key = gr.Textbox(label="API Key", type="password", placeholder="Enter your Google AI API key")
|
| 133 |
model = gr.Dropdown(
|
|
|
|
| 160 |
sexually_explicit = gr.Dropdown(label="Sexually Explicit", choices=["BLOCK_NONE", "BLOCK_ONLY_HIGH", "BLOCK_MEDIUM_AND_ABOVE", "BLOCK_LOW_AND_ABOVE"], value="BLOCK_MEDIUM_AND_ABOVE")
|
| 161 |
dangerous_content = gr.Dropdown(label="Dangerous Content", choices=["BLOCK_NONE", "BLOCK_ONLY_HIGH", "BLOCK_MEDIUM_AND_ABOVE", "BLOCK_LOW_AND_ABOVE"], value="BLOCK_MEDIUM_AND_ABOVE")
|
| 162 |
|
| 163 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 164 |
|
| 165 |
gr.Markdown("""
|
| 166 |
## 🔧 Settings:
|