Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -7,9 +7,9 @@ ttp = pipeline("text2text-generation", model="aware-ai/marian-german-grammar")
|
|
7 |
|
8 |
def transcribe(audio):
|
9 |
transcribed = p(audio, chunk_length_s=10, stride_length_s=(4, 2))["text"].lower()
|
10 |
-
|
11 |
|
12 |
-
return transcribed
|
13 |
|
14 |
gr.Interface(
|
15 |
fn=transcribe,
|
|
|
7 |
|
8 |
def transcribe(audio):
|
9 |
transcribed = p(audio, chunk_length_s=10, stride_length_s=(4, 2))["text"].lower()
|
10 |
+
transcribed_corrected = ttp(re.sub("[^a-zA-Z0-9öäüÖÄÜ ]", " ",transcribed))[0]["generated_text"]
|
11 |
|
12 |
+
return transcribed + "\n" + transcribed_corrected
|
13 |
|
14 |
gr.Interface(
|
15 |
fn=transcribe,
|