oceansweep commited on
Commit
7e9de24
·
verified ·
1 Parent(s): 17d4987

Adding the callout for setting the environ value...

Browse files
App_Function_Libraries/Gradio_Related.py CHANGED
@@ -68,6 +68,7 @@ from App_Function_Libraries.Video_DL_Ingestion_Lib import parse_and_expand_urls,
68
  # Function Definitions
69
  #
70
 
 
71
  whisper_models = ["small", "medium", "small.en", "medium.en", "medium", "large", "large-v1", "large-v2", "large-v3",
72
  "distil-large-v2", "distil-medium.en", "distil-small.en"]
73
  custom_prompt_input = None
@@ -673,7 +674,7 @@ def create_video_transcription_tab():
673
  label="API Name (Mandatory)")
674
  api_key_input = gr.Textbox(label="API Key (Mandatory)", placeholder="Enter your API key here",
675
  type="password",
676
- value=f"{MISTRAL_TOKEN}")
677
  keywords_input = gr.Textbox(label="Keywords", placeholder="Enter keywords here (comma-separated)",
678
  value="default,no_keyword_set")
679
  batch_size_input = gr.Slider(minimum=1, maximum=10, value=1, step=1,
@@ -1324,7 +1325,7 @@ def create_audio_processing_tab():
1324
  )
1325
  api_key_input = gr.Textbox(label="API Key (if required)", placeholder="Enter your API key here",
1326
  type="password",
1327
- value=f"{MISTRAL_TOKEN}")
1328
  custom_keywords_input = gr.Textbox(label="Custom Keywords", placeholder="Enter custom keywords, comma-separated")
1329
  keep_original_input = gr.Checkbox(label="Keep original audio file", value=False)
1330
 
@@ -1434,7 +1435,7 @@ def create_podcast_tab():
1434
  )
1435
  podcast_api_key_input = gr.Textbox(label="API Key (if required)",
1436
  type="password",
1437
- value=f"{MISTRAL_TOKEN}")
1438
  podcast_whisper_model_input = gr.Dropdown(choices=whisper_models, value="medium", label="Whisper Model")
1439
 
1440
  keep_original_input = gr.Checkbox(label="Keep original audio file", value=False)
@@ -1558,7 +1559,7 @@ def create_website_scraping_tab():
1558
  api_key_input = gr.Textbox(label="API Key (Mandatory if API Name is specified)",
1559
  placeholder="Enter your API key here; Ignore if using Local API or Built-in API",
1560
  type="password",
1561
- value=f"{MISTRAL_TOKEN}")
1562
  keywords_input = gr.Textbox(label="Keywords", placeholder="Enter keywords here (comma-separated)",
1563
  value="default,no_keyword_set", visible=True)
1564
 
@@ -1671,7 +1672,7 @@ def create_resummary_tab():
1671
  api_key_input = gr.Textbox(label="API Key",
1672
  placeholder="Enter your API key here",
1673
  type="password",
1674
- value=f"{MISTRAL_TOKEN}")
1675
 
1676
  chunking_options_checkbox = gr.Checkbox(label="Use Chunking", value=False)
1677
  with gr.Row(visible=False) as chunking_options_box:
@@ -2874,7 +2875,7 @@ def create_chat_interface():
2874
  value="Mistral")
2875
  api_key = gr.Textbox(label="API Key (if required)",
2876
  type="password",
2877
- value=f"{MISTRAL_TOKEN}")
2878
  custom_prompt_checkbox = gr.Checkbox(label="Use a Custom Prompt",
2879
  value=False,
2880
  visible=True)
@@ -3085,7 +3086,7 @@ def create_chat_interface_editable():
3085
  value="Mistral")
3086
  api_key = gr.Textbox(label="API Key (if required)",
3087
  type="password",
3088
- value=f"{MISTRAL_TOKEN}")
3089
  # preset_prompt_checkbox = gr.Checkbox(label="Use a pre-set Prompt",
3090
  # value=False,
3091
  # visible=True)
@@ -3288,7 +3289,7 @@ def create_chat_interface_stacked():
3288
  value="Mistral")
3289
  api_key = gr.Textbox(label="API Key (if required)",
3290
  type="password",
3291
- value=f"{MISTRAL_TOKEN}")
3292
  preset_prompt = gr.Dropdown(label="Select Preset Prompt",
3293
  choices=load_preset_prompts(),
3294
  visible=True)
@@ -3462,7 +3463,7 @@ def create_chat_interface_multi_api():
3462
  value="Mistral")
3463
  api_key = gr.Textbox(label=f"API Key {i + 1} (if required)",
3464
  type="password",
3465
- value=f"{MISTRAL_TOKEN}")
3466
  temperature = gr.Slider(label=f"Temperature {i + 1}", minimum=0.0, maximum=1.0, step=0.1, value=0.7)
3467
  chatbot = gr.Chatbot(height=800, elem_classes="chat-window")
3468
  chatbots.append(chatbot)
@@ -3574,7 +3575,7 @@ def create_chat_interface_four():
3574
  "DeepSeek", "Mistral", "OpenRouter", "Llama.cpp", "Kobold", "Ooba",
3575
  "Tabbyapi", "VLLM", "HuggingFace"],
3576
  value="Mistral")
3577
- api_key = gr.Textbox(label=f"API Key {i + 1} (if required)", type="password", value=f"{MISTRAL_TOKEN}")
3578
  temperature = gr.Slider(label=f"Temperature {i + 1}", minimum=0.0, maximum=1.0, step=0.1, value=0.7)
3579
  chatbot = gr.Chatbot(height=400, elem_classes="chat-window")
3580
  msg = gr.Textbox(label=f"Enter your message for Chat {i + 1}")
@@ -3665,7 +3666,7 @@ def create_chat_interface_vertical():
3665
  with gr.Row():
3666
  api_key = gr.Textbox(label="API Key (if required)",
3667
  type="password",
3668
- value=f"{MISTRAL_TOKEN}")
3669
  with gr.Row():
3670
  temperature = gr.Slider(label="Temperature", minimum=0.0, maximum=1.0, step=0.1, value=0.7)
3671
  with gr.Row():
@@ -4364,7 +4365,7 @@ def create_import_item_tab():
4364
  )
4365
  api_key_input = gr.Textbox(label="API Key",
4366
  type="password",
4367
- value=f"{MISTRAL_TOKEN}")
4368
  with gr.Row():
4369
  import_button = gr.Button("Import Data")
4370
  with gr.Row():
@@ -4701,7 +4702,7 @@ def create_import_book_tab():
4701
  )
4702
  api_key_input = gr.Textbox(label="API Key",
4703
  type="password",
4704
- value=f"{MISTRAL_TOKEN}")
4705
  import_button = gr.Button("Import eBook")
4706
  with gr.Column():
4707
  with gr.Row():
@@ -5138,7 +5139,7 @@ def create_document_editing_tab():
5138
  )
5139
  api_key_input = gr.Textbox(label="API Key (if not set in config.txt)", placeholder="Enter your API key here",
5140
  type="password",
5141
- value=f"{MISTRAL_TOKEN}")
5142
  check_grammar_button = gr.Button("Check Grammar and Style")
5143
 
5144
  with gr.Column():
@@ -5168,7 +5169,7 @@ def create_document_editing_tab():
5168
  )
5169
  api_key_input = gr.Textbox(label="API Key (if not set in config.txt)", placeholder="Enter your API key here",
5170
  type="password",
5171
- value=f"{MISTRAL_TOKEN}")
5172
  adjust_btn = gr.Button("Adjust Tone")
5173
 
5174
  with gr.Column():
 
68
  # Function Definitions
69
  #
70
 
71
+ MISTRAL_TOKEN = os.environ["MISTRAL_KEY"]
72
  whisper_models = ["small", "medium", "small.en", "medium.en", "medium", "large", "large-v1", "large-v2", "large-v3",
73
  "distil-large-v2", "distil-medium.en", "distil-small.en"]
74
  custom_prompt_input = None
 
674
  label="API Name (Mandatory)")
675
  api_key_input = gr.Textbox(label="API Key (Mandatory)", placeholder="Enter your API key here",
676
  type="password",
677
+ value=MISTRAL_TOKEN)
678
  keywords_input = gr.Textbox(label="Keywords", placeholder="Enter keywords here (comma-separated)",
679
  value="default,no_keyword_set")
680
  batch_size_input = gr.Slider(minimum=1, maximum=10, value=1, step=1,
 
1325
  )
1326
  api_key_input = gr.Textbox(label="API Key (if required)", placeholder="Enter your API key here",
1327
  type="password",
1328
+ value=MISTRAL_TOKEN)
1329
  custom_keywords_input = gr.Textbox(label="Custom Keywords", placeholder="Enter custom keywords, comma-separated")
1330
  keep_original_input = gr.Checkbox(label="Keep original audio file", value=False)
1331
 
 
1435
  )
1436
  podcast_api_key_input = gr.Textbox(label="API Key (if required)",
1437
  type="password",
1438
+ value=MISTRAL_TOKEN)
1439
  podcast_whisper_model_input = gr.Dropdown(choices=whisper_models, value="medium", label="Whisper Model")
1440
 
1441
  keep_original_input = gr.Checkbox(label="Keep original audio file", value=False)
 
1559
  api_key_input = gr.Textbox(label="API Key (Mandatory if API Name is specified)",
1560
  placeholder="Enter your API key here; Ignore if using Local API or Built-in API",
1561
  type="password",
1562
+ value=MISTRAL_TOKEN)
1563
  keywords_input = gr.Textbox(label="Keywords", placeholder="Enter keywords here (comma-separated)",
1564
  value="default,no_keyword_set", visible=True)
1565
 
 
1672
  api_key_input = gr.Textbox(label="API Key",
1673
  placeholder="Enter your API key here",
1674
  type="password",
1675
+ value=MISTRAL_TOKEN)
1676
 
1677
  chunking_options_checkbox = gr.Checkbox(label="Use Chunking", value=False)
1678
  with gr.Row(visible=False) as chunking_options_box:
 
2875
  value="Mistral")
2876
  api_key = gr.Textbox(label="API Key (if required)",
2877
  type="password",
2878
+ value=MISTRAL_TOKEN)
2879
  custom_prompt_checkbox = gr.Checkbox(label="Use a Custom Prompt",
2880
  value=False,
2881
  visible=True)
 
3086
  value="Mistral")
3087
  api_key = gr.Textbox(label="API Key (if required)",
3088
  type="password",
3089
+ value=MISTRAL_TOKEN)
3090
  # preset_prompt_checkbox = gr.Checkbox(label="Use a pre-set Prompt",
3091
  # value=False,
3092
  # visible=True)
 
3289
  value="Mistral")
3290
  api_key = gr.Textbox(label="API Key (if required)",
3291
  type="password",
3292
+ value=MISTRAL_TOKEN)
3293
  preset_prompt = gr.Dropdown(label="Select Preset Prompt",
3294
  choices=load_preset_prompts(),
3295
  visible=True)
 
3463
  value="Mistral")
3464
  api_key = gr.Textbox(label=f"API Key {i + 1} (if required)",
3465
  type="password",
3466
+ value=MISTRAL_TOKEN)
3467
  temperature = gr.Slider(label=f"Temperature {i + 1}", minimum=0.0, maximum=1.0, step=0.1, value=0.7)
3468
  chatbot = gr.Chatbot(height=800, elem_classes="chat-window")
3469
  chatbots.append(chatbot)
 
3575
  "DeepSeek", "Mistral", "OpenRouter", "Llama.cpp", "Kobold", "Ooba",
3576
  "Tabbyapi", "VLLM", "HuggingFace"],
3577
  value="Mistral")
3578
+ api_key = gr.Textbox(label=f"API Key {i + 1} (if required)", type="password", value=MISTRAL_TOKEN)
3579
  temperature = gr.Slider(label=f"Temperature {i + 1}", minimum=0.0, maximum=1.0, step=0.1, value=0.7)
3580
  chatbot = gr.Chatbot(height=400, elem_classes="chat-window")
3581
  msg = gr.Textbox(label=f"Enter your message for Chat {i + 1}")
 
3666
  with gr.Row():
3667
  api_key = gr.Textbox(label="API Key (if required)",
3668
  type="password",
3669
+ value=MISTRAL_TOKEN)
3670
  with gr.Row():
3671
  temperature = gr.Slider(label="Temperature", minimum=0.0, maximum=1.0, step=0.1, value=0.7)
3672
  with gr.Row():
 
4365
  )
4366
  api_key_input = gr.Textbox(label="API Key",
4367
  type="password",
4368
+ value=MISTRAL_TOKEN)
4369
  with gr.Row():
4370
  import_button = gr.Button("Import Data")
4371
  with gr.Row():
 
4702
  )
4703
  api_key_input = gr.Textbox(label="API Key",
4704
  type="password",
4705
+ value=MISTRAL_TOKEN)
4706
  import_button = gr.Button("Import eBook")
4707
  with gr.Column():
4708
  with gr.Row():
 
5139
  )
5140
  api_key_input = gr.Textbox(label="API Key (if not set in config.txt)", placeholder="Enter your API key here",
5141
  type="password",
5142
+ value=MISTRAL_TOKEN)
5143
  check_grammar_button = gr.Button("Check Grammar and Style")
5144
 
5145
  with gr.Column():
 
5169
  )
5170
  api_key_input = gr.Textbox(label="API Key (if not set in config.txt)", placeholder="Enter your API key here",
5171
  type="password",
5172
+ value=MISTRAL_TOKEN)
5173
  adjust_btn = gr.Button("Adjust Tone")
5174
 
5175
  with gr.Column():