jpdiazpardo commited on
Commit
03e41cf
1 Parent(s): cebb0cb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -12,9 +12,9 @@ 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"
20
  BATCH_SIZE = 8
@@ -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(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,12 +100,12 @@ 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
109
 
110
  #Ouput components
111
  audio_out = gr.Audio(label="Processed Audio", type="filepath", info = "Vocals only")
 
12
  from functions.timestamp import format_timestamp
13
  from functions.youtube import get_youtube_video_id
14
  #---------------------------------------------------------------------
15
+ examples = [["https://www.youtube.com/watch?v=W72Lnz1n-jw&ab_channel=Whitechapel-Topic",
16
+ "<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"
20
  BATCH_SIZE = 8
 
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
  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
109
 
110
  #Ouput components
111
  audio_out = gr.Audio(label="Processed Audio", type="filepath", info = "Vocals only")