sotirios-slv commited on
Commit
34aef7d
1 Parent(s): 9a88197

Reverted to large model, updated descriptive intro

Browse files
Files changed (1) hide show
  1. app.py +10 -9
app.py CHANGED
@@ -9,13 +9,6 @@ from transformers import (
9
  pipeline,
10
  )
11
 
12
- description = """
13
- <div>
14
- <p>This is a demonstration of OpenAi's Whisper speech-to-text model</p>
15
- <p>Users are invited to read and record a script, which is then converted to text with a score output</p>
16
- </div>
17
- """
18
-
19
 
20
  # diction_text = """
21
  # How is this leisure to be disposed of? In the public-house? the singing hall? the dancing-saloon? which hold out seductions somewhat more dangerous, methinks, to honest labor than those presented by a library; or in listless inaction, in weary unoccupied solitude? That cannot be. While man is a social animal society he must have, and better a thousand times that he should seek relief from the tedium of unemployed hours in the improving conversation of worthy authors, dead or living, than in the debasing, brutalising communications from which it is so difficult otherwise to escape.
@@ -32,8 +25,16 @@ device = "cpu"
32
 
33
  torch_dtype = torch.float16 if torch.cuda.is_available() else torch.float32
34
 
35
- model_id = "openai/whisper-base "
36
- # model_id = "openai/whisper-large-v3"
 
 
 
 
 
 
 
 
37
 
38
 
39
  model = AutoModelForSpeechSeq2Seq.from_pretrained(
 
9
  pipeline,
10
  )
11
 
 
 
 
 
 
 
 
12
 
13
  # diction_text = """
14
  # How is this leisure to be disposed of? In the public-house? the singing hall? the dancing-saloon? which hold out seductions somewhat more dangerous, methinks, to honest labor than those presented by a library; or in listless inaction, in weary unoccupied solitude? That cannot be. While man is a social animal society he must have, and better a thousand times that he should seek relief from the tedium of unemployed hours in the improving conversation of worthy authors, dead or living, than in the debasing, brutalising communications from which it is so difficult otherwise to escape.
 
25
 
26
  torch_dtype = torch.float16 if torch.cuda.is_available() else torch.float32
27
 
28
+ # model_id = "openai/whisper-base "
29
+ model_id = "openai/whisper-large-v3"
30
+
31
+ description = f"""
32
+ <div>
33
+ <p>Welcome to redmond Barryoke! This app aims to demonstrate the potential of using machine learning to transcribe audio.</p>
34
+ <p>The app invites users to record themselves reading an brief and abridged excerpt from a speech delivered by Redmond Barry at the opening of The Free Public Library of Ballarat Est in 1869. Once recorded and submitted the app will transcribe and return a "diction" score.</p>
35
+ <p>This app uses {model_id} to power it's automated transcription</p>
36
+ </div>
37
+ """
38
 
39
 
40
  model = AutoModelForSpeechSeq2Seq.from_pretrained(