oceansweep commited on
Commit
69e3d45
1 Parent(s): 41ba402

Upload Gradio_Related.py

Browse files
Files changed (1) hide show
  1. App_Function_Libraries/Gradio_Related.py +359 -330
App_Function_Libraries/Gradio_Related.py CHANGED
@@ -1,330 +1,359 @@
1
- # Gradio_Related.py
2
- #########################################
3
- # Gradio UI Functions Library
4
- # I fucking hate Gradio.
5
- #
6
- #########################################
7
- #
8
- # Built-In Imports
9
- import logging
10
- #
11
- # Import 3rd-Party Libraries
12
- import gradio as gr
13
- #
14
- # Local Imports
15
- from App_Function_Libraries.DB_Manager import get_db_config
16
- from App_Function_Libraries.Gradio_UI.Audio_ingestion_tab import create_audio_processing_tab
17
- from App_Function_Libraries.Gradio_UI.Chat_ui import chat_workflows_tab, create_chat_management_tab, \
18
- create_chat_interface_four, create_chat_interface_multi_api, create_chat_interface_stacked, create_chat_interface
19
- from App_Function_Libraries.Gradio_UI.Explain_summarize_tab import create_summarize_explain_tab
20
- from App_Function_Libraries.Gradio_UI.Export_Functionality import create_export_tab, create_backup_tab, \
21
- create_view_backups_tab, create_restore_backup_tab
22
- from App_Function_Libraries.Gradio_UI.Import_Functionality import create_import_single_prompt_tab, \
23
- create_import_obsidian_vault_tab, create_import_item_tab, create_import_book_tab, create_import_multiple_prompts_tab
24
- from App_Function_Libraries.Gradio_UI.Introduction_tab import create_introduction_tab
25
- from App_Function_Libraries.Gradio_UI.Keywords import create_view_keywords_tab, create_add_keyword_tab, \
26
- create_delete_keyword_tab, create_export_keywords_tab
27
- from App_Function_Libraries.Gradio_UI.Llamafile_tab import create_chat_with_llamafile_tab
28
- from App_Function_Libraries.Gradio_UI.Media_edit import create_prompt_clone_tab, create_prompt_edit_tab, \
29
- create_media_edit_and_clone_tab, create_media_edit_tab
30
- from App_Function_Libraries.Gradio_UI.PDF_ingestion_tab import create_pdf_ingestion_tab, create_pdf_ingestion_test_tab
31
- from App_Function_Libraries.Gradio_UI.Podcast_tab import create_podcast_tab
32
- from App_Function_Libraries.Gradio_UI.Re_summarize_tab import create_resummary_tab
33
- from App_Function_Libraries.Gradio_UI.Search_Tab import create_prompt_view_tab, create_prompt_search_tab, \
34
- create_search_summaries_tab, create_viewing_tab, create_search_tab
35
- from App_Function_Libraries.Gradio_UI.Trash import create_view_trash_tab, create_empty_trash_tab, \
36
- create_delete_trash_tab
37
- from App_Function_Libraries.Gradio_UI.Utilities import create_utilities_yt_timestamp_tab, create_utilities_yt_audio_tab, \
38
- create_utilities_yt_video_tab
39
- from App_Function_Libraries.Gradio_UI.Video_transcription_tab import create_video_transcription_tab
40
- from App_Function_Libraries.Gradio_UI.Website_scraping_tab import create_website_scraping_tab
41
- #
42
- # Gradio UI Imports
43
- from App_Function_Libraries.Gradio_UI.geval import create_geval_tab
44
-
45
- #
46
- #######################################################################################################################
47
- # Function Definitions
48
- #
49
-
50
-
51
- custom_prompt_input = None
52
- server_mode = False
53
- share_public = False
54
- custom_prompt_summarize_bulleted_notes = ("""
55
- <s>You are a bulleted notes specialist. [INST]```When creating comprehensive bulleted notes, you should follow these guidelines: Use multiple headings based on the referenced topics, not categories like quotes or terms. Headings should be surrounded by bold formatting and not be listed as bullet points themselves. Leave no space between headings and their corresponding list items underneath. Important terms within the content should be emphasized by setting them in bold font. Any text that ends with a colon should also be bolded. Before submitting your response, review the instructions, and make any corrections necessary to adhered to the specified format. Do not reference these instructions within the notes.``` \nBased on the content between backticks create comprehensive bulleted notes.[/INST]
56
- **Bulleted Note Creation Guidelines**
57
-
58
- **Headings**:
59
- - Based on referenced topics, not categories like quotes or terms
60
- - Surrounded by **bold** formatting
61
- - Not listed as bullet points
62
- - No space between headings and list items underneath
63
-
64
- **Emphasis**:
65
- - **Important terms** set in bold font
66
- - **Text ending in a colon**: also bolded
67
-
68
- **Review**:
69
- - Ensure adherence to specified format
70
- - Do not reference these instructions in your response.</s>[INST] {{ .Prompt }} [/INST]
71
- """)
72
- #
73
- # End of globals
74
- #######################################################################################################################
75
- #
76
- # Start of Video/Audio Transcription and Summarization Functions
77
- #
78
- # Functions:
79
- # FIXME
80
- #
81
- #
82
- ################################################################################################################
83
- # Functions for Re-Summarization
84
- #
85
- # Functions:
86
- # FIXME
87
- # End of Re-Summarization Functions
88
- #
89
- ############################################################################################################################################################################################################################
90
- #
91
- # Explain/Summarize This Tab
92
- #
93
- # Functions:
94
- # FIXME
95
- #
96
- #
97
- ############################################################################################################################################################################################################################
98
- #
99
- # Transcript Comparison Tab
100
- #
101
- # Functions:
102
- # FIXME
103
- #
104
- #
105
- ###########################################################################################################################################################################################################################
106
- #
107
- # Search Tab
108
- #
109
- # Functions:
110
- # FIXME
111
- #
112
- # End of Search Tab Functions
113
- #
114
- ##############################################################################################################################################################################################################################
115
- #
116
- # Llamafile Tab
117
- #
118
- # Functions:
119
- # FIXME
120
- #
121
- # End of Llamafile Tab Functions
122
- ##############################################################################################################################################################################################################################
123
- #
124
- # Chat Interface Tab Functions
125
- #
126
- # Functions:
127
- # FIXME
128
- #
129
- #
130
- # End of Chat Interface Tab Functions
131
- ################################################################################################################################################################################################################################
132
- #
133
- # Media Edit Tab Functions
134
- # Functions:
135
- # Fixme
136
- # create_media_edit_tab():
137
- ##### Trash Tab
138
- # FIXME
139
- # Functions:
140
- #
141
- # End of Media Edit Tab Functions
142
- ################################################################################################################
143
- #
144
- # Import Items Tab Functions
145
- #
146
- # Functions:
147
- #FIXME
148
- # End of Import Items Tab Functions
149
- ################################################################################################################
150
- #
151
- # Export Items Tab Functions
152
- #
153
- # Functions:
154
- # FIXME
155
- #
156
- #
157
- # End of Export Items Tab Functions
158
- ################################################################################################################
159
- #
160
- # Keyword Management Tab Functions
161
- #
162
- # Functions:
163
- # create_view_keywords_tab():
164
- # FIXME
165
- #
166
- # End of Keyword Management Tab Functions
167
- ################################################################################################################
168
- #
169
- # Document Editing Tab Functions
170
- #
171
- # Functions:
172
- # #FIXME
173
- #
174
- #
175
- ################################################################################################################
176
- #
177
- # Utilities Tab Functions
178
- # Functions:
179
- # create_utilities_yt_video_tab():
180
- # #FIXME
181
-
182
- #
183
- # End of Utilities Tab Functions
184
- ################################################################################################################
185
-
186
- # FIXME - Prompt sample box
187
- #
188
- # # Sample data
189
- # prompts_category_1 = [
190
- # "What are the key points discussed in the video?",
191
- # "Summarize the main arguments made by the speaker.",
192
- # "Describe the conclusions of the study presented."
193
- # ]
194
- #
195
- # prompts_category_2 = [
196
- # "How does the proposed solution address the problem?",
197
- # "What are the implications of the findings?",
198
- # "Can you explain the theory behind the observed phenomenon?"
199
- # ]
200
- #
201
- # all_prompts2 = prompts_category_1 + prompts_category_2
202
-
203
-
204
- def launch_ui(share_public=None, server_mode=False):
205
- share=share_public
206
- css = """
207
- .result-box {
208
- margin-bottom: 20px;
209
- border: 1px solid #ddd;
210
- padding: 10px;
211
- }
212
- .result-box.error {
213
- border-color: #ff0000;
214
- background-color: #ffeeee;
215
- }
216
- .transcription, .summary {
217
- max-height: 300px;
218
- overflow-y: auto;
219
- border: 1px solid #eee;
220
- padding: 10px;
221
- margin-top: 10px;
222
- }
223
- """
224
-
225
- with gr.Blocks(theme='bethecloud/storj_theme',css=css) as iface:
226
- db_config = get_db_config()
227
- db_type = db_config['type']
228
- gr.Markdown(f"# tl/dw: Your LLM-powered Research Multi-tool")
229
- gr.Markdown(f"(Using {db_type.capitalize()} Database)")
230
- with gr.Tabs():
231
- with gr.TabItem("Transcription / Summarization / Ingestion"):
232
- with gr.Tabs():
233
- create_video_transcription_tab()
234
- create_audio_processing_tab()
235
- create_podcast_tab()
236
- create_import_book_tab()
237
- create_website_scraping_tab()
238
- create_pdf_ingestion_tab()
239
- create_pdf_ingestion_test_tab()
240
- create_resummary_tab()
241
- create_summarize_explain_tab()
242
-
243
- with gr.TabItem("Search / Detailed View"):
244
- create_search_tab()
245
- #create_rag_tab()
246
- #create_embeddings_tab()
247
- create_viewing_tab()
248
- create_search_summaries_tab()
249
- create_prompt_search_tab()
250
- create_prompt_view_tab()
251
-
252
- with gr.TabItem("Chat with an LLM"):
253
- create_chat_interface()
254
- create_chat_interface_stacked()
255
- create_chat_interface_multi_api()
256
- create_chat_interface_four()
257
- create_chat_with_llamafile_tab()
258
- create_chat_management_tab()
259
- chat_workflows_tab()
260
- from App_Function_Libraries.Gradio_UI.Writing import create_character_card_interaction_tab
261
- create_character_card_interaction_tab()
262
-
263
-
264
- with gr.TabItem("Edit Existing Items"):
265
- create_media_edit_tab()
266
- create_media_edit_and_clone_tab()
267
- create_prompt_edit_tab()
268
- create_prompt_clone_tab()
269
- # FIXME
270
- #create_compare_transcripts_tab()
271
-
272
- with gr.TabItem("Writing Tools"):
273
- with gr.Tabs():
274
- from App_Function_Libraries.Gradio_UI.Writing import create_document_feedback_tab
275
- create_document_feedback_tab()
276
- from App_Function_Libraries.Gradio_UI.Writing import create_grammar_style_check_tab
277
- create_grammar_style_check_tab()
278
- from App_Function_Libraries.Gradio_UI.Writing import create_tone_adjustment_tab
279
- create_tone_adjustment_tab()
280
- from App_Function_Libraries.Gradio_UI.Writing import create_creative_writing_tab
281
- create_creative_writing_tab()
282
- from App_Function_Libraries.Gradio_UI.Writing import create_mikupad_tab
283
- create_mikupad_tab()
284
-
285
-
286
- with gr.TabItem("Keywords"):
287
- create_view_keywords_tab()
288
- create_add_keyword_tab()
289
- create_delete_keyword_tab()
290
- create_export_keywords_tab()
291
-
292
- with gr.TabItem("Import/Export"):
293
- create_import_item_tab()
294
- create_import_obsidian_vault_tab()
295
- create_import_single_prompt_tab()
296
- create_import_multiple_prompts_tab()
297
- create_export_tab()
298
-
299
- with gr.TabItem("Backup Management"):
300
- create_backup_tab()
301
- create_view_backups_tab()
302
- create_restore_backup_tab()
303
-
304
- with gr.TabItem("Utilities"):
305
- create_utilities_yt_video_tab()
306
- create_utilities_yt_audio_tab()
307
- create_utilities_yt_timestamp_tab()
308
-
309
- with gr.TabItem("Trashcan"):
310
- create_view_trash_tab()
311
- create_delete_trash_tab()
312
- create_empty_trash_tab()
313
-
314
- with gr.TabItem("Evaluations"):
315
- create_geval_tab()
316
-
317
- with gr.TabItem("Introduction/Help"):
318
- create_introduction_tab()
319
-
320
- # Launch the interface
321
- server_port_variable = 7860
322
- if share==True:
323
- iface.launch(share=True)
324
- elif server_mode and not share_public:
325
- iface.launch(share=False, server_name="0.0.0.0", server_port=server_port_variable)
326
- else:
327
- try:
328
- iface.launch(share=False)
329
- except Exception as e:
330
- logging.error(f"Error launching interface: {str(e)}")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Gradio_Related.py
2
+ #########################################
3
+ # Gradio UI Functions Library
4
+ # I fucking hate Gradio.
5
+ # Yea, fuck Gradio. https://github.com/gradio-app/gradio/pull/8263 & https://github.com/gradio-app/gradio/issues/7968
6
+ #
7
+ #########################################
8
+ #
9
+ # Built-In Imports
10
+ import logging
11
+ import os
12
+ #
13
+ # Import 3rd-Party Libraries
14
+ import gradio as gr
15
+ #
16
+ # Local Imports
17
+ from App_Function_Libraries.DB.DB_Manager import get_db_config
18
+ from App_Function_Libraries.Gradio_UI.Audio_ingestion_tab import create_audio_processing_tab
19
+ from App_Function_Libraries.Gradio_UI.Chat_ui import create_chat_management_tab, \
20
+ create_chat_interface_four, create_chat_interface_multi_api, create_chat_interface_stacked, create_chat_interface
21
+ from App_Function_Libraries.Gradio_UI.Config_tab import create_config_editor_tab
22
+ from App_Function_Libraries.Gradio_UI.Explain_summarize_tab import create_summarize_explain_tab
23
+ from App_Function_Libraries.Gradio_UI.Export_Functionality import create_export_tab
24
+ from App_Function_Libraries.Gradio_UI.Backup_Functionality import create_backup_tab, create_view_backups_tab, \
25
+ create_restore_backup_tab
26
+ from App_Function_Libraries.Gradio_UI.Import_Functionality import create_import_single_prompt_tab, \
27
+ create_import_obsidian_vault_tab, create_import_item_tab, create_import_book_tab, create_import_multiple_prompts_tab
28
+ from App_Function_Libraries.Gradio_UI.Introduction_tab import create_introduction_tab
29
+ from App_Function_Libraries.Gradio_UI.Keywords import create_view_keywords_tab, create_add_keyword_tab, \
30
+ create_delete_keyword_tab, create_export_keywords_tab
31
+ from App_Function_Libraries.Gradio_UI.Live_Recording import create_live_recording_tab
32
+ from App_Function_Libraries.Gradio_UI.Llamafile_tab import create_chat_with_llamafile_tab
33
+ from App_Function_Libraries.Gradio_UI.Media_edit import create_prompt_clone_tab, create_prompt_edit_tab, \
34
+ create_media_edit_and_clone_tab, create_media_edit_tab
35
+ from App_Function_Libraries.Gradio_UI.Media_wiki_tab import create_mediawiki_import_tab
36
+ from App_Function_Libraries.Gradio_UI.PDF_ingestion_tab import create_pdf_ingestion_tab, create_pdf_ingestion_test_tab
37
+ from App_Function_Libraries.Gradio_UI.Podcast_tab import create_podcast_tab
38
+ from App_Function_Libraries.Gradio_UI.RAG_QA_Chat_tab import create_rag_qa_chat_tab
39
+ from App_Function_Libraries.Gradio_UI.Re_summarize_tab import create_resummary_tab
40
+ from App_Function_Libraries.Gradio_UI.Search_Tab import create_prompt_view_tab, create_prompt_search_tab, \
41
+ create_search_summaries_tab, create_viewing_tab, create_search_tab
42
+ from App_Function_Libraries.Gradio_UI.RAG_Chat_tab import create_embeddings_tab, create_rag_tab, \
43
+ create_view_embeddings_tab
44
+ from App_Function_Libraries.Gradio_UI.Trash import create_view_trash_tab, create_empty_trash_tab, \
45
+ create_delete_trash_tab, create_search_and_mark_trash_tab
46
+ from App_Function_Libraries.Gradio_UI.Utilities import create_utilities_yt_timestamp_tab, create_utilities_yt_audio_tab, \
47
+ create_utilities_yt_video_tab
48
+ from App_Function_Libraries.Gradio_UI.Video_transcription_tab import create_video_transcription_tab
49
+ from App_Function_Libraries.Gradio_UI.View_tab import create_manage_items_tab
50
+ from App_Function_Libraries.Gradio_UI.Website_scraping_tab import create_website_scraping_tab
51
+ from App_Function_Libraries.Gradio_UI.Chat_Workflows import chat_workflows_tab
52
+ #
53
+ # Gradio UI Imports
54
+ from App_Function_Libraries.Gradio_UI.Evaluations_Benchmarks_tab import create_geval_tab, create_infinite_bench_tab
55
+
56
+ #
57
+ #######################################################################################################################
58
+ # Function Definitions
59
+ #
60
+
61
+
62
+ # Disable Gradio Analytics
63
+ os.environ['GRADIO_ANALYTICS_ENABLED'] = 'False'
64
+
65
+
66
+ custom_prompt_input = None
67
+ server_mode = False
68
+ share_public = False
69
+ custom_prompt_summarize_bulleted_notes = ("""
70
+ <s>You are a bulleted notes specialist. [INST]```When creating comprehensive bulleted notes, you should follow these guidelines: Use multiple headings based on the referenced topics, not categories like quotes or terms. Headings should be surrounded by bold formatting and not be listed as bullet points themselves. Leave no space between headings and their corresponding list items underneath. Important terms within the content should be emphasized by setting them in bold font. Any text that ends with a colon should also be bolded. Before submitting your response, review the instructions, and make any corrections necessary to adhered to the specified format. Do not reference these instructions within the notes.``` \nBased on the content between backticks create comprehensive bulleted notes.[/INST]
71
+ **Bulleted Note Creation Guidelines**
72
+
73
+ **Headings**:
74
+ - Based on referenced topics, not categories like quotes or terms
75
+ - Surrounded by **bold** formatting
76
+ - Not listed as bullet points
77
+ - No space between headings and list items underneath
78
+
79
+ **Emphasis**:
80
+ - **Important terms** set in bold font
81
+ - **Text ending in a colon**: also bolded
82
+
83
+ **Review**:
84
+ - Ensure adherence to specified format
85
+ - Do not reference these instructions in your response.</s>[INST] {{ .Prompt }} [/INST]
86
+ """)
87
+ #
88
+ # End of globals
89
+ #######################################################################################################################
90
+ #
91
+ # Start of Video/Audio Transcription and Summarization Functions
92
+ #
93
+ # Functions:
94
+ # FIXME
95
+ #
96
+ #
97
+ ################################################################################################################
98
+ # Functions for Re-Summarization
99
+ #
100
+ # Functions:
101
+ # FIXME
102
+ # End of Re-Summarization Functions
103
+ #
104
+ ############################################################################################################################################################################################################################
105
+ #
106
+ # Explain/Summarize This Tab
107
+ #
108
+ # Functions:
109
+ # FIXME
110
+ #
111
+ #
112
+ ############################################################################################################################################################################################################################
113
+ #
114
+ # Transcript Comparison Tab
115
+ #
116
+ # Functions:
117
+ # FIXME
118
+ #
119
+ #
120
+ ###########################################################################################################################################################################################################################
121
+ #
122
+ # Search Tab
123
+ #
124
+ # Functions:
125
+ # FIXME
126
+ #
127
+ # End of Search Tab Functions
128
+ #
129
+ ##############################################################################################################################################################################################################################
130
+ #
131
+ # Llamafile Tab
132
+ #
133
+ # Functions:
134
+ # FIXME
135
+ #
136
+ # End of Llamafile Tab Functions
137
+ ##############################################################################################################################################################################################################################
138
+ #
139
+ # Chat Interface Tab Functions
140
+ #
141
+ # Functions:
142
+ # FIXME
143
+ #
144
+ #
145
+ # End of Chat Interface Tab Functions
146
+ ################################################################################################################################################################################################################################
147
+ #
148
+ # Media Edit Tab Functions
149
+ # Functions:
150
+ # Fixme
151
+ # create_media_edit_tab():
152
+ ##### Trash Tab
153
+ # FIXME
154
+ # Functions:
155
+ #
156
+ # End of Media Edit Tab Functions
157
+ ################################################################################################################
158
+ #
159
+ # Import Items Tab Functions
160
+ #
161
+ # Functions:
162
+ #FIXME
163
+ # End of Import Items Tab Functions
164
+ ################################################################################################################
165
+ #
166
+ # Export Items Tab Functions
167
+ #
168
+ # Functions:
169
+ # FIXME
170
+ #
171
+ #
172
+ # End of Export Items Tab Functions
173
+ ################################################################################################################
174
+ #
175
+ # Keyword Management Tab Functions
176
+ #
177
+ # Functions:
178
+ # create_view_keywords_tab():
179
+ # FIXME
180
+ #
181
+ # End of Keyword Management Tab Functions
182
+ ################################################################################################################
183
+ #
184
+ # Document Editing Tab Functions
185
+ #
186
+ # Functions:
187
+ # #FIXME
188
+ #
189
+ #
190
+ ################################################################################################################
191
+ #
192
+ # Utilities Tab Functions
193
+ # Functions:
194
+ # create_utilities_yt_video_tab():
195
+ # #FIXME
196
+
197
+ #
198
+ # End of Utilities Tab Functions
199
+ ################################################################################################################
200
+
201
+ # FIXME - Prompt sample box
202
+ #
203
+ # # Sample data
204
+ # prompts_category_1 = [
205
+ # "What are the key points discussed in the video?",
206
+ # "Summarize the main arguments made by the speaker.",
207
+ # "Describe the conclusions of the study presented."
208
+ # ]
209
+ #
210
+ # prompts_category_2 = [
211
+ # "How does the proposed solution address the problem?",
212
+ # "What are the implications of the findings?",
213
+ # "Can you explain the theory behind the observed phenomenon?"
214
+ # ]
215
+ #
216
+ # all_prompts2 = prompts_category_1 + prompts_category_2
217
+
218
+
219
+ def launch_ui(share_public=None, server_mode=False):
220
+ share=share_public
221
+ css = """
222
+ .result-box {
223
+ margin-bottom: 20px;
224
+ border: 1px solid #ddd;
225
+ padding: 10px;
226
+ }
227
+ .result-box.error {
228
+ border-color: #ff0000;
229
+ background-color: #ffeeee;
230
+ }
231
+ .transcription, .summary {
232
+ max-height: 300px;
233
+ overflow-y: auto;
234
+ border: 1px solid #eee;
235
+ padding: 10px;
236
+ margin-top: 10px;
237
+ }
238
+ """
239
+
240
+ with gr.Blocks(theme='bethecloud/storj_theme',css=css) as iface:
241
+ db_config = get_db_config()
242
+ db_type = db_config['type']
243
+ gr.Markdown(f"# tl/dw: Your LLM-powered Research Multi-tool")
244
+ gr.Markdown(f"(Using {db_type.capitalize()} Database)")
245
+ with gr.Tabs():
246
+ with gr.TabItem("Transcription / Summarization / Ingestion"):
247
+ with gr.Tabs():
248
+ create_video_transcription_tab()
249
+ create_audio_processing_tab()
250
+ create_podcast_tab()
251
+ create_import_book_tab()
252
+ create_website_scraping_tab()
253
+ create_pdf_ingestion_tab()
254
+ create_pdf_ingestion_test_tab()
255
+ create_resummary_tab()
256
+ create_summarize_explain_tab()
257
+ create_live_recording_tab()
258
+
259
+ with gr.TabItem("Text Search "):
260
+ create_search_tab()
261
+ create_search_summaries_tab()
262
+ create_prompt_search_tab()
263
+
264
+ with gr.TabItem("RAG Search / Embeddings"):
265
+ create_rag_tab()
266
+ create_rag_qa_chat_tab()
267
+ create_embeddings_tab()
268
+ create_view_embeddings_tab()
269
+
270
+ with gr.TabItem("Chat with an LLM"):
271
+ create_chat_interface()
272
+ create_chat_interface_stacked()
273
+ create_chat_interface_multi_api()
274
+ create_chat_interface_four()
275
+ create_chat_with_llamafile_tab()
276
+ create_chat_management_tab()
277
+ chat_workflows_tab()
278
+ from App_Function_Libraries.Gradio_UI.Writing_tab import create_character_card_interaction_tab
279
+ create_character_card_interaction_tab()
280
+
281
+ with gr.TabItem("View DB Items"):
282
+ create_viewing_tab()
283
+ create_prompt_view_tab()
284
+
285
+ with gr.TabItem("Manage / Edit Existing Items"):
286
+ create_media_edit_tab()
287
+ create_manage_items_tab()
288
+ create_media_edit_and_clone_tab()
289
+ create_prompt_edit_tab()
290
+ create_prompt_clone_tab()
291
+ # FIXME
292
+ #create_compare_transcripts_tab()
293
+
294
+ with gr.TabItem("Writing Tools"):
295
+ with gr.Tabs():
296
+ from App_Function_Libraries.Gradio_UI.Writing_tab import create_document_feedback_tab
297
+ create_document_feedback_tab()
298
+ from App_Function_Libraries.Gradio_UI.Writing_tab import create_grammar_style_check_tab
299
+ create_grammar_style_check_tab()
300
+ from App_Function_Libraries.Gradio_UI.Writing_tab import create_tone_adjustment_tab
301
+ create_tone_adjustment_tab()
302
+ from App_Function_Libraries.Gradio_UI.Writing_tab import create_creative_writing_tab
303
+ create_creative_writing_tab()
304
+ from App_Function_Libraries.Gradio_UI.Writing_tab import create_mikupad_tab
305
+ create_mikupad_tab()
306
+
307
+
308
+ with gr.TabItem("Keywords"):
309
+ create_view_keywords_tab()
310
+ create_add_keyword_tab()
311
+ create_delete_keyword_tab()
312
+ create_export_keywords_tab()
313
+
314
+ with gr.TabItem("Import/Export"):
315
+ create_import_item_tab()
316
+ create_import_obsidian_vault_tab()
317
+ create_import_single_prompt_tab()
318
+ create_import_multiple_prompts_tab()
319
+ create_mediawiki_import_tab()
320
+ create_export_tab()
321
+
322
+ with gr.TabItem("Backup Management"):
323
+ create_backup_tab()
324
+ create_view_backups_tab()
325
+ create_restore_backup_tab()
326
+
327
+ with gr.TabItem("Utilities"):
328
+ create_utilities_yt_video_tab()
329
+ create_utilities_yt_audio_tab()
330
+ create_utilities_yt_timestamp_tab()
331
+
332
+ with gr.TabItem("Trashcan"):
333
+ create_search_and_mark_trash_tab()
334
+ create_view_trash_tab()
335
+ create_delete_trash_tab()
336
+ create_empty_trash_tab()
337
+
338
+ with gr.TabItem("Evaluations"):
339
+ create_geval_tab()
340
+ create_infinite_bench_tab()
341
+
342
+ with gr.TabItem("Introduction/Help"):
343
+ create_introduction_tab()
344
+
345
+ with gr.TabItem("Config Editor"):
346
+ create_config_editor_tab()
347
+
348
+ # Launch the interface
349
+ server_port_variable = 7860
350
+ GRADIO_ANALYTICS_ENABLED = False
351
+ if share==True:
352
+ iface.launch(share=True)
353
+ elif server_mode and not share_public:
354
+ iface.launch(share=False, server_name="0.0.0.0", server_port=server_port_variable, )
355
+ else:
356
+ try:
357
+ iface.launch(share=False)
358
+ except Exception as e:
359
+ logging.error(f"Error launching interface: {str(e)}")