zelk12 commited on
Commit
1b4edb5
·
verified ·
1 Parent(s): b22fe89

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +54 -20
app.py CHANGED
@@ -1,3 +1,6 @@
 
 
 
1
  #=========
2
  #=========
3
  # Library Import
@@ -27,26 +30,32 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue="teal", secondary_hue="slate", n
27
  "API",
28
  open=False,
29
  ):
30
- with gr.Row():
31
- gr.Textbox(
32
  label="API key",
33
  scale=4,
34
  )
35
  with gr.Column():
36
- gr.Button(
37
  value="Apply",
38
  scale=1,
39
  )
40
- gr.Button(
41
  value="Reset",
42
  scale=1,
43
  )
44
- gr.Markdown("API key State: False")
45
-
46
- gr.Dropdown(label="Choose provider")
47
- gr.Markdown("Provider State: False")
 
 
 
 
 
 
48
 
49
- gr.ChatInterface(random_response,
50
  multimodal=True,
51
  chatbot=gr.Chatbot(
52
  label="output",
@@ -59,34 +68,59 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue="teal", secondary_hue="slate", n
59
  title="Chat interface test",
60
  save_history=True,
61
  )
62
- gr.Markdown("Token in output: False")
63
- gr.Markdown("Token in input: False")
64
 
65
  with gr.Accordion(
66
  "Settings",
67
  open=False,
68
  ):
69
- gr.Dropdown(label="Choose model")
70
- gr.Textbox(label="System instructions",)
71
- gr.Slider(label="temperature",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  interactive=True,
73
  minimum=0,
74
  maximum=2,
75
  value=0.95)
76
- gr.Slider(label="topP",
77
  interactive=True,
78
  minimum=0,
79
  maximum=1,
80
  value=0.5)
81
- gr.Slider(label="topK",
82
  interactive=True,
83
  value=100)
84
- gr.Checkbox(
85
  label="Enable output stream"
86
- )
87
- gr.Checkbox(
88
  label="Grounding with Google Search"
89
- )
90
 
91
  if __name__ == "__main__":
92
  demo.launch()
 
1
+ # Попробую писать коментарии на двух языках.
2
+ # I'll try to write bilingual comments.
3
+
4
  #=========
5
  #=========
6
  # Library Import
 
30
  "API",
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.
50
+
51
+ Dropdown_Block_Choose_provider = gr.Dropdown(label="Choose provider")
52
+ # На данный момент времени единственным провайдером будет Google и Google API для доступа к Gemini. (19.04.2025)
53
+ # At this point in time, the only provider will be Google and the Google API to access Gemini. (19.04.2025)
54
+ Markdown_Block_Povider_State = gr.Markdown("Provider State: False")
55
+ # Варианты используеться, выбранный провайдер и указание его наименования и провайдер не используеться, и причины.
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",
 
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)
80
+ # Gemini 2.5 Pro Experimental (5 зпаросов в минуту, 250.000 токенов в минуту, 25 запросов в день) (19.04.2025)
81
+ # Gemini 2.0 Flash (15 зпаросов в минуту, 1.000.000 токенов в минуту, 1.500 запросов в день) (19.04.2025)
82
+ # Gemini 2.0 Flash Experimental (10 зпаросов в минуту, 1.000.000 токенов в минуту, 1.500 запросов в день) (19.04.2025)
83
+ # Gemini 2.0 Flash-Lite (30 зпаросов в минуту, 1.000.000 токенов в минуту, 1.500 запросов в день) (19.04.2025)
84
+ # Gemini 1.5 Flash (15 зпаросов в минуту, 1.000.000 токенов в минуту, 1.500 запросов в день) (19.04.2025)
85
+ # Gemini 1.5 Flash-8B (15 зпаросов в минуту, 1.000.000 токенов в минуту, 1.500 запросов в день) (19.04.2025)
86
+ # Gemini 1.5 Pro (2 зпаросов в минуту, 32.000 токенов в минуту, 50 запросов в день) (19.04.2025)
87
+ # Gemma 3 (30 зпаросов в минуту, 15.000 токенов в минуту, 14.400 запросов в день) (19.04.2025)
88
+ # По умалчанию будет выбрана модель: Gemini 2.0 Flash Experimental (19.04.2025)
89
+ #
90
+ # The following models will be used from Google: Gemini 2.5 Flash Preview 04-17 (10 zparos per minute, 250,000 tokens per minute, 500 requests per day) (19.04.2025)
91
+ # Gemini 2.5 Pro Experimental (5 drops per minute, 250,000 tokens per minute, 25 requests per day) (19.04.2025)
92
+ # Gemini 2.0 Flash (15 drops per minute, 1,000,000 tokens per minute, 1,500 requests per day) (19.04.2025)
93
+ # Gemini 2.0 Flash Experimental (10 drops per minute, 1,000,000 tokens per minute, 1,500 requests per day) (19.04.2025)
94
+ # Gemini 2.0 Flash-Lite (30 drops per minute, 1,000,000 tokens per minute, 1,500 requests per day) (19.04.2025)
95
+ # Gemini 1.5 Flash (15 drops per minute, 1,000,000 tokens per minute, 1,500 requests per day) (19.04.2025)
96
+ # Gemini 1.5 Flash-8B (15 drops per minute, 1,000,000 tokens per minute, 1,500 requests per day) (19.04.2025)
97
+ # Gemini 1.5 Pro (2 drops per minute, 32,000 tokens per minute, 50 requests per day) (19.04.2025)
98
+ # Gemma 3 (30 zparos per minute, 15.000 tokens per minute, 14.400 requests per day) (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
+
104
+ Textbox_Block_System_instructions = gr.Textbox(label="System instructions",)
105
+ Slier_Block_Model_Temperature = gr.Slider(label="temperature",
106
  interactive=True,
107
  minimum=0,
108
  maximum=2,
109
  value=0.95)
110
+ Slier_Block_Model_topP = gr.Slider(label="topP",
111
  interactive=True,
112
  minimum=0,
113
  maximum=1,
114
  value=0.5)
115
+ Slier_Block_Model_topK = gr.Slider(label="topK",
116
  interactive=True,
117
  value=100)
118
+ Checkbox_Block_Output_Stream = gr.Checkbox(
119
  label="Enable output stream"
120
+ )
121
+ Checkbox_Block_Google_Grounding_Search = gr.Checkbox(
122
  label="Grounding with Google Search"
123
+ )
124
 
125
  if __name__ == "__main__":
126
  demo.launch()