sotirios-slv commited on
Commit
cfe5d15
·
1 Parent(s): eeb2fc4

Reveal button testing

Browse files
Files changed (1) hide show
  1. app.py +14 -6
app.py CHANGED
@@ -11,21 +11,29 @@ from transformers import (
11
 
12
  description = """
13
  <div>
14
- <p>This is 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
  diction_text = """
20
- State Library Victoria is the state library of Victoria, Australia.
21
- Located in Melbourne, it was established in 1854 as the Melbourne Public Library, making it Australia's oldest public library and one of the first free libraries in the world.
22
- It is also Australia's busiest public library and, as of 2023, the third busiest library globally.
23
- In 1853, the decision to build a combined library, museum and gallery was made at the instigation of Governor of Victoria Charles La Trobe and Sir Redmond Barry.
24
- A competition was held, won by the recently arrived architect Joseph Reed, whose firm and its successors went on to design most of the later extensions, as well as numerous 19th-century landmarks such as the Melbourne Town Hall, and the Royal Exhibition Building.
25
  """
26
 
27
  diction_script = gr.Textbox(diction_text, interactive=False, show_label=False)
28
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  device = "cpu"
30
 
31
  torch_dtype = torch.float16 if torch.cuda.is_available() else torch.float32
 
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
  diction_text = """
20
+ State Library Victoria is the state library of Victoria, Australia. Located in Melbourne, it was established in 1854 as the Melbourne Public Library, making it Australia's oldest public library and one of the first free libraries in the world. It is also Australia's busiest public library and, as of 2023, the third busiest library globally. In 1853, the decision to build a combined library, museum and gallery was made at the instigation of Governor of Victoria Charles La Trobe and Sir Redmond Barry. A competition was held, won by the recently arrived architect Joseph Reed, whose firm and its successors went on to design most of the later extensions, as well as numerous 19th-century landmarks such as the Melbourne Town Hall, and the Royal Exhibition Building.
 
 
 
 
21
  """
22
 
23
  diction_script = gr.Textbox(diction_text, interactive=False, show_label=False)
24
 
25
+
26
+ def update_visibility(text_box):
27
+
28
+ print("text_box")
29
+ print(text_box)
30
+
31
+ return text_box
32
+
33
+
34
+ button = gr.Button("Reveal script")
35
+ button.click(update_visibility, inputs=diction_script, outputs=diction_script)
36
+
37
  device = "cpu"
38
 
39
  torch_dtype = torch.float16 if torch.cuda.is_available() else torch.float32