oceansweep commited on
Commit
adada7e
1 Parent(s): 805099a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -1262,7 +1262,7 @@ def launch_ui(demo_mode=False):
1262
  gr.components.Textbox(label="URL", placeholder="Enter the video URL here"),
1263
  gr.components.Number(value=2, label="Number of Speakers"),
1264
  gr.components.Dropdown(choices=whisper_models, value="small.en", label="Whisper Model"),
1265
- gr.components.Textbox(label="Custom Prompt", placeholder="Enter a custom prompt here", lines=3),
1266
  gr.components.Number(value=0, label="Offset"),
1267
  gr.components.Dropdown(
1268
  choices=["huggingface", "openai", "anthropic", "cohere", "groq", "llama", "kobold", "ooba"],
@@ -1458,6 +1458,14 @@ if __name__ == "__main__":
1458
  #parser.add_argument('--log_file', action=str, help='Where to save logfile (non-default)')
1459
  args = parser.parse_args()
1460
 
 
 
 
 
 
 
 
 
1461
  print(f"Is CUDA available: {torch.cuda.is_available()}")
1462
  # True
1463
  print(f"CUDA device: {torch.cuda.get_device_name(torch.cuda.current_device())}")
 
1262
  gr.components.Textbox(label="URL", placeholder="Enter the video URL here"),
1263
  gr.components.Number(value=2, label="Number of Speakers"),
1264
  gr.components.Dropdown(choices=whisper_models, value="small.en", label="Whisper Model"),
1265
+ gr.components.Textbox(label="Custom Prompt", placeholder="Q: As a professional summarizer, create a concise and comprehensive summary of the provided text.\nA: Here is a detailed, bulleted list of the key points made in the transcribed video and supporting arguments:", lines=3),
1266
  gr.components.Number(value=0, label="Offset"),
1267
  gr.components.Dropdown(
1268
  choices=["huggingface", "openai", "anthropic", "cohere", "groq", "llama", "kobold", "ooba"],
 
1458
  #parser.add_argument('--log_file', action=str, help='Where to save logfile (non-default)')
1459
  args = parser.parse_args()
1460
 
1461
+ if args.custom_prompt == "":
1462
+ logging.debug(f"Custom prompt defined, will use \n\nf{args.custom_prompt} \n\nas prompt")
1463
+ print(f"Custom Prompt has been defined. Custom prompt: \n\n {args.custom_prompt}")
1464
+ else:
1465
+ logging.debug("No custom prompt defined, will use default")
1466
+ args.custom_prompt = "\n\nQ: As a professional summarizer, create a concise and comprehensive summary of the provided text.\nA: Here is a detailed, bulleted list of the key points made in the transcribed video and supporting arguments:"
1467
+ print("No custom prompt defined, will use default")
1468
+
1469
  print(f"Is CUDA available: {torch.cuda.is_available()}")
1470
  # True
1471
  print(f"CUDA device: {torch.cuda.get_device_name(torch.cuda.current_device())}")