Update app.py
Browse files
app.py
CHANGED
|
@@ -31,19 +31,19 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue="teal", secondary_hue="slate", n
|
|
| 31 |
open=False,
|
| 32 |
):
|
| 33 |
with gr.Row():
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
with gr.Column():
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
Markdown_Block_API_key_State = gr.Markdown("API key State: False")
|
| 48 |
# Возможные варианты, используеться стандартный API ключь и используеться выбранный API ключь.
|
| 49 |
# Possible options, standard API key is used and selected API key is used.
|
|
@@ -56,24 +56,24 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue="teal", secondary_hue="slate", n
|
|
| 56 |
# The options are used, the selected provider and the name of the provider and the provider not used, and the reasons.
|
| 57 |
|
| 58 |
ChatIntarface_Block_Main_chat_window = gr.ChatInterface(random_response,
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
Markdown_Block_Output_token = gr.Markdown("Token in output: False")
|
| 72 |
Markdown_Block_Input_token = gr.Markdown("Token in input: False")
|
| 73 |
|
| 74 |
with gr.Accordion(
|
| 75 |
-
|
| 76 |
-
|
| 77 |
):
|
| 78 |
Dropdown_Block_Choose_model = gr.Dropdown(label="Choose model")
|
| 79 |
# От Google будут использованы следующие модели: Gemini 2.5 Flash Preview 04-17 (10 зпаросов в минуту, 250.000 токенов в минуту, 500 запросов в день) (19.04.2025)
|
|
@@ -99,28 +99,29 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue="teal", secondary_hue="slate", n
|
|
| 99 |
# Gemini 2.0 Flash Experimental will be chosen by default. (19.04.2025)
|
| 100 |
# Translated with www.DeepL.com/Translator (free version)
|
| 101 |
|
| 102 |
-
# Я даже не буду исправлять этот
|
|
|
|
| 103 |
|
| 104 |
Textbox_Block_System_instructions = gr.Textbox(label="System instructions",)
|
| 105 |
Slier_Block_Model_Temperature = gr.Slider(label="temperature",
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
Slier_Block_Model_topP = gr.Slider(label="topP",
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
Slier_Block_Model_topK = gr.Slider(label="topK",
|
| 116 |
-
|
| 117 |
-
|
| 118 |
Checkbox_Block_Output_Stream = gr.Checkbox(
|
| 119 |
-
|
| 120 |
-
|
| 121 |
Checkbox_Block_Google_Grounding_Search = gr.Checkbox(
|
| 122 |
-
|
| 123 |
-
|
| 124 |
|
| 125 |
if __name__ == "__main__":
|
| 126 |
demo.launch()
|
|
|
|
| 31 |
open=False,
|
| 32 |
):
|
| 33 |
with gr.Row():
|
| 34 |
+
Textbox_Block_API_key = gr.Textbox(
|
| 35 |
+
label="API key",
|
| 36 |
+
scale=4,
|
| 37 |
+
)
|
| 38 |
with gr.Column():
|
| 39 |
+
Button_Block_Apply_API_key = gr.Button(
|
| 40 |
+
value="Apply",
|
| 41 |
+
scale=1,
|
| 42 |
+
)
|
| 43 |
+
Button_Block_Reset_API_key = gr.Button(
|
| 44 |
+
value="Reset",
|
| 45 |
+
scale=1,
|
| 46 |
+
)
|
| 47 |
Markdown_Block_API_key_State = gr.Markdown("API key State: False")
|
| 48 |
# Возможные варианты, используеться стандартный API ключь и используеться выбранный API ключь.
|
| 49 |
# Possible options, standard API key is used and selected API key is used.
|
|
|
|
| 56 |
# The options are used, the selected provider and the name of the provider and the provider not used, and the reasons.
|
| 57 |
|
| 58 |
ChatIntarface_Block_Main_chat_window = gr.ChatInterface(random_response,
|
| 59 |
+
multimodal=True,
|
| 60 |
+
chatbot=gr.Chatbot(
|
| 61 |
+
label="output",
|
| 62 |
+
),
|
| 63 |
+
type="messages",
|
| 64 |
+
textbox=gr.MultimodalTextbox(
|
| 65 |
+
label="input",
|
| 66 |
+
),
|
| 67 |
+
editable=True,
|
| 68 |
+
title="Chat interface test",
|
| 69 |
+
save_history=True,
|
| 70 |
+
)
|
| 71 |
Markdown_Block_Output_token = gr.Markdown("Token in output: False")
|
| 72 |
Markdown_Block_Input_token = gr.Markdown("Token in input: False")
|
| 73 |
|
| 74 |
with gr.Accordion(
|
| 75 |
+
"Settings",
|
| 76 |
+
open=False,
|
| 77 |
):
|
| 78 |
Dropdown_Block_Choose_model = gr.Dropdown(label="Choose model")
|
| 79 |
# От Google будут использованы следующие модели: Gemini 2.5 Flash Preview 04-17 (10 зпаросов в минуту, 250.000 токенов в минуту, 500 запросов в день) (19.04.2025)
|
|
|
|
| 99 |
# Gemini 2.0 Flash Experimental will be chosen by default. (19.04.2025)
|
| 100 |
# Translated with www.DeepL.com/Translator (free version)
|
| 101 |
|
| 102 |
+
# Я даже не буду исправлять этот преревод.
|
| 103 |
+
# I'm not even gonna fix this pre-translation #
|
| 104 |
|
| 105 |
Textbox_Block_System_instructions = gr.Textbox(label="System instructions",)
|
| 106 |
Slier_Block_Model_Temperature = gr.Slider(label="temperature",
|
| 107 |
+
interactive=True,
|
| 108 |
+
minimum=0,
|
| 109 |
+
maximum=2,
|
| 110 |
+
value=0.95)
|
| 111 |
Slier_Block_Model_topP = gr.Slider(label="topP",
|
| 112 |
+
interactive=True,
|
| 113 |
+
minimum=0,
|
| 114 |
+
maximum=1,
|
| 115 |
+
value=0.5)
|
| 116 |
Slier_Block_Model_topK = gr.Slider(label="topK",
|
| 117 |
+
interactive=True,
|
| 118 |
+
value=100)
|
| 119 |
Checkbox_Block_Output_Stream = gr.Checkbox(
|
| 120 |
+
label="Enable output stream"
|
| 121 |
+
)
|
| 122 |
Checkbox_Block_Google_Grounding_Search = gr.Checkbox(
|
| 123 |
+
label="Grounding with Google Search"
|
| 124 |
+
)
|
| 125 |
|
| 126 |
if __name__ == "__main__":
|
| 127 |
demo.launch()
|