Update app.py
Browse files
app.py
CHANGED
|
@@ -23,7 +23,9 @@ speaker_embeddings = torch.tensor(embeddings_dataset[7306]["xvector"]).unsqueeze
|
|
| 23 |
|
| 24 |
print(speaker_embeddings.shape)
|
| 25 |
|
|
|
|
| 26 |
if 0:
|
|
|
|
| 27 |
def translate(audio):
|
| 28 |
outputs = asr_pipe(audio, max_new_tokens=256, generate_kwargs={"task": "translate"})
|
| 29 |
return outputs["text"]
|
|
@@ -73,3 +75,13 @@ if 0:
|
|
| 73 |
gr.TabbedInterface([mic_translate, file_translate], ["Microphone", "Audio File"])
|
| 74 |
|
| 75 |
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
print(speaker_embeddings.shape)
|
| 25 |
|
| 26 |
+
|
| 27 |
if 0:
|
| 28 |
+
|
| 29 |
def translate(audio):
|
| 30 |
outputs = asr_pipe(audio, max_new_tokens=256, generate_kwargs={"task": "translate"})
|
| 31 |
return outputs["text"]
|
|
|
|
| 75 |
gr.TabbedInterface([mic_translate, file_translate], ["Microphone", "Audio File"])
|
| 76 |
|
| 77 |
demo.launch()
|
| 78 |
+
|
| 79 |
+
else:
|
| 80 |
+
|
| 81 |
+
def greet(name):
|
| 82 |
+
return "Hello " + name
|
| 83 |
+
|
| 84 |
+
|
| 85 |
+
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
|
| 86 |
+
|
| 87 |
+
demo.launch()
|