Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -24,11 +24,12 @@ def transcribe(audio_file):
|
|
24 |
return transcription
|
25 |
|
26 |
#define a function to process your input and output
|
27 |
-
def zero_shot(doc, candidates):
|
28 |
given_labels = candidates.split(", ")
|
29 |
dictionary = classifier(doc, given_labels)
|
30 |
labels = dictionary['labels']
|
31 |
scores = dictionary['scores']
|
|
|
32 |
return dict(zip(labels, scores))
|
33 |
|
34 |
#create input and output objects
|
@@ -47,6 +48,7 @@ audio = gr.Audio(
|
|
47 |
|
48 |
#output object
|
49 |
output = gr.Label(label="Output")
|
|
|
50 |
#example object
|
51 |
examples = [
|
52 |
["TDC A/S provides communications and entertainment solutions in Denmark. It operates through Nuuday and TDC NET segments. The company designs, builds, and operates broadband and mobile networks; and provides technical support to customers and networks. It offers services, such as landline voice, TV and streaming, broadband, Internet and network, mobility, and other services. The company provides its products and services under the YouSee, Hiper, Telmore, Blockbuster, TDC Business, TDC Erhverv, Fullrate, NetDesign, and Relatel brands. It serves consumer and business customers. The company was founded in 1882 and is based in Copenhagen, Denmark. TDC A/S is a subsidiary of DK Telekommunikation ApS.", "Diversified Telecommunication Services, Wireless Telecommunication Services, Media, Entertainment, Interactive Media and Services"],
|
@@ -57,7 +59,7 @@ examples = [
|
|
57 |
gui = gr.Interface(title=title,
|
58 |
description=description,
|
59 |
fn=zero_shot,
|
60 |
-
inputs=[input1, input2]
|
61 |
outputs=[output],
|
62 |
examples=examples)
|
63 |
|
|
|
24 |
return transcription
|
25 |
|
26 |
#define a function to process your input and output
|
27 |
+
def zero_shot(doc, candidates, aud):
|
28 |
given_labels = candidates.split(", ")
|
29 |
dictionary = classifier(doc, given_labels)
|
30 |
labels = dictionary['labels']
|
31 |
scores = dictionary['scores']
|
32 |
+
print("here is the audio transcribed: ", aud)
|
33 |
return dict(zip(labels, scores))
|
34 |
|
35 |
#create input and output objects
|
|
|
48 |
|
49 |
#output object
|
50 |
output = gr.Label(label="Output")
|
51 |
+
|
52 |
#example object
|
53 |
examples = [
|
54 |
["TDC A/S provides communications and entertainment solutions in Denmark. It operates through Nuuday and TDC NET segments. The company designs, builds, and operates broadband and mobile networks; and provides technical support to customers and networks. It offers services, such as landline voice, TV and streaming, broadband, Internet and network, mobility, and other services. The company provides its products and services under the YouSee, Hiper, Telmore, Blockbuster, TDC Business, TDC Erhverv, Fullrate, NetDesign, and Relatel brands. It serves consumer and business customers. The company was founded in 1882 and is based in Copenhagen, Denmark. TDC A/S is a subsidiary of DK Telekommunikation ApS.", "Diversified Telecommunication Services, Wireless Telecommunication Services, Media, Entertainment, Interactive Media and Services"],
|
|
|
59 |
gui = gr.Interface(title=title,
|
60 |
description=description,
|
61 |
fn=zero_shot,
|
62 |
+
inputs=[input1, input2, audio],
|
63 |
outputs=[output],
|
64 |
examples=examples)
|
65 |
|