Harshad Bhandwaldar commited on
Commit
97970d4
·
1 Parent(s): ef69a46

model added

Browse files
Files changed (1) hide show
  1. app.py +2 -91
app.py CHANGED
@@ -20,94 +20,11 @@ def speech_record(x):
20
  text = model.transcribe([f"{x}"])
21
  return text
22
 
23
- css = """
24
- .gradio-container {
25
- font-family: 'IBM Plex Sans', sans-serif;
26
- }
27
- .gr-button {
28
- color: white;
29
- border-color: black;
30
- background: black;
31
- }
32
- input[type='range'] {
33
- accent-color: black;
34
- }
35
- .dark input[type='range'] {
36
- accent-color: #dfdfdf;
37
- }
38
- .container {
39
- max-width: 730px;
40
- margin: auto;
41
- padding-top: 1.5rem;
42
- }
43
-
44
- .details:hover {
45
- text-decoration: underline;
46
- }
47
- .gr-button {
48
- white-space: nowrap;
49
- }
50
- .gr-button:focus {
51
- border-color: rgb(147 197 253 / var(--tw-border-opacity));
52
- outline: none;
53
- box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
54
- --tw-border-opacity: 1;
55
- --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
56
- --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px var(--tw-ring-offset-width)) var(--tw-ring-color);
57
- --tw-ring-color: rgb(191 219 254 / var(--tw-ring-opacity));
58
- --tw-ring-opacity: .5;
59
- }
60
- .footer {
61
- margin-bottom: 45px;
62
- margin-top: 35px;
63
- text-align: center;
64
- border-bottom: 1px solid #e5e5e5;
65
- }
66
- .footer>p {
67
- font-size: .8rem;
68
- display: inline-block;
69
- padding: 0 10px;
70
- transform: translateY(10px);
71
- background: white;
72
- }
73
- .dark .footer {
74
- border-color: #303030;
75
- }
76
- .dark .footer>p {
77
- background: #0b0f19;
78
- }
79
- .prompt h4{
80
- margin: 1.25em 0 .25em 0;
81
- font-weight: bold;
82
- font-size: 115%;
83
- }
84
- .animate-spin {
85
- animation: spin 1s linear infinite;
86
- }
87
- @keyframes spin {
88
- from {
89
- transform: rotate(0deg);
90
- }
91
- to {
92
- transform: rotate(360deg);
93
- }
94
- }
95
- #share-btn-container {
96
- display: flex; margin-top: 1.5rem !important; padding-left: 0.5rem !important; padding-right: 0.5rem !important; background-color: #000000; justify-content: center; align-items: center; border-radius: 9999px !important; width: 13rem;
97
- }
98
- #share-btn {
99
- all: initial; color: #ffffff;font-weight: 600; cursor:pointer; font-family: 'IBM Plex Sans', sans-serif; margin-left: 0.5rem !important; padding-top: 0.25rem !important; padding-bottom: 0.25rem !important;
100
- }
101
- #share-btn * {
102
- all: unset;
103
- }
104
- """
105
 
106
- with gr.Blocks(css = css) as demo:
107
  gr.Markdown(
108
  """
109
- # Speech to Text - NVIDIA Qaurtznet15x5 (English)
110
- QuartzNet is a Jasper-like network that uses separable convolutions and larger filter sizes. It has comparable accuracy to Jasper while having much fewer parameters. This particular model has 15 blocks each repeated 5 times.
111
  """)
112
 
113
  with gr.Tab("Audio File"):
@@ -121,12 +38,6 @@ with gr.Blocks(css = css) as demo:
121
  audio_input3 = gr.Audio(label="Input Audio", source="microphone", type="filepath")
122
  text_output3 = gr.Textbox(label="Transcription", show_label=False)
123
  rec_button = gr.Button("Transcribe")
124
- gr.HTML('''
125
- <div class="footer">
126
- <p></a>
127
- </p>
128
- </div>
129
- ''')
130
 
131
  file_button.click(speech_file, inputs=audio_input2, outputs=text_output2)
132
  rec_button.click(speech_record, inputs=audio_input3, outputs=text_output3)
 
20
  text = model.transcribe([f"{x}"])
21
  return text
22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
 
24
+ with gr.Blocks() as demo:
25
  gr.Markdown(
26
  """
27
+ ## Speech to Text - NVIDIA Qaurtznet15x5 (English)
 
28
  """)
29
 
30
  with gr.Tab("Audio File"):
 
38
  audio_input3 = gr.Audio(label="Input Audio", source="microphone", type="filepath")
39
  text_output3 = gr.Textbox(label="Transcription", show_label=False)
40
  rec_button = gr.Button("Transcribe")
 
 
 
 
 
 
41
 
42
  file_button.click(speech_file, inputs=audio_input2, outputs=text_output2)
43
  rec_button.click(speech_record, inputs=audio_input3, outputs=text_output3)