jpdiazpardo commited on
Commit
450a858
1 Parent(s): 7088191

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -12,8 +12,8 @@ from functions.icon import generate_icon
12
  from functions.timestamp import format_timestamp
13
  from functions.youtube import get_youtube_video_id
14
  #---------------------------------------------------------------------
15
- examples = [["When a Demon Defiles a Witch.wav", #"https://www.youtube.com/watch?v=W72Lnz1n-jw&ab_channel=Whitechapel-Topic",
16
- "When a Demon Defiles a Witch.wav", #"<iframe src='https://www.youtube.com/embed/W72Lnz1n-jw' title='YouTube video player' frameborder='0' allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture' allowfullscreen></iframe>",
17
  "When a Demon Defiles a Witch.wav",True, True]]
18
 
19
  MODEL_NAME = "openai/whisper-medium"
@@ -49,7 +49,7 @@ title = "Scream: Fine-Tuned Whisper model for automatic gutural speech recogniti
49
  classifier = pipeline("text-classification", model="j-hartmann/emotion-english-distilroberta-base", top_k=None)
50
 
51
  #Functions-----------------------------------------------------------------------------------------------------------------------
52
- def transcribe(link,thumbnail,file,use_timestamps,sentiment_analysis):#file, return_timestamps, *kwargs):
53
  '''inputs: file, return_timestamps'''
54
  outputs = pipe(file, batch_size=BATCH_SIZE, generate_kwargs={"task": 'transcribe'}, return_timestamps=True)
55
  text = outputs["text"]
@@ -100,9 +100,9 @@ download_button = gr.Button(value="Download")
100
  thumbnail = gr.HTML(value=embed_html, visible=False, label = "Thumbnail")
101
  sa_checkbox = gr.Checkbox(value=True, label="Sentiment analysis")
102
 
103
- inputs = [yt_link, #0
104
  #download_button, #1
105
- thumbnail, #2
106
  audio_input, #3
107
  gr.Checkbox(value=True, label="Return timestamps"), #4
108
  sa_checkbox] #5
 
12
  from functions.timestamp import format_timestamp
13
  from functions.youtube import get_youtube_video_id
14
  #---------------------------------------------------------------------
15
+ examples = [[#"When a Demon Defiles a Witch.wav", #"https://www.youtube.com/watch?v=W72Lnz1n-jw&ab_channel=Whitechapel-Topic",
16
+ #"When a Demon Defiles a Witch.wav", #"<iframe src='https://www.youtube.com/embed/W72Lnz1n-jw' title='YouTube video player' frameborder='0' allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture' allowfullscreen></iframe>",
17
  "When a Demon Defiles a Witch.wav",True, True]]
18
 
19
  MODEL_NAME = "openai/whisper-medium"
 
49
  classifier = pipeline("text-classification", model="j-hartmann/emotion-english-distilroberta-base", top_k=None)
50
 
51
  #Functions-----------------------------------------------------------------------------------------------------------------------
52
+ def transcribe(file,use_timestamps,sentiment_analysis):#file, return_timestamps, *kwargs):
53
  '''inputs: file, return_timestamps'''
54
  outputs = pipe(file, batch_size=BATCH_SIZE, generate_kwargs={"task": 'transcribe'}, return_timestamps=True)
55
  text = outputs["text"]
 
100
  thumbnail = gr.HTML(value=embed_html, visible=False, label = "Thumbnail")
101
  sa_checkbox = gr.Checkbox(value=True, label="Sentiment analysis")
102
 
103
+ inputs = [#yt_link, #0
104
  #download_button, #1
105
+ #thumbnail, #2
106
  audio_input, #3
107
  gr.Checkbox(value=True, label="Return timestamps"), #4
108
  sa_checkbox] #5