Spaces:
Runtime error
Runtime error
Zeimoto
commited on
Commit
·
7b86f35
1
Parent(s):
1f50a3c
fixed translation length
Browse files
app.py
CHANGED
|
@@ -12,13 +12,13 @@ def main ():
|
|
| 12 |
print(f"Running main")
|
| 13 |
|
| 14 |
#print(subprocess.Popen('pip freeze > requirements_hug.txt', shell=True))
|
| 15 |
-
original = "Tenho uma proposta para a Caixa Geral de Depositos, para 3 consultores Outsystems, 300 euros por dia e um periodo de seis meses."
|
| 16 |
-
st.write(f"Original: {original}")
|
| 17 |
# traducao = get_translation(text_to_translate=text, languageCode="pt")
|
| 18 |
# st.write(traducao)
|
| 19 |
|
| 20 |
-
translation = translate(original)
|
| 21 |
-
st.write(f"Translation: {translation}")
|
| 22 |
print("Rendering UI...")
|
| 23 |
start_render = set_start()
|
| 24 |
wav_audio_data = st_audiorec()
|
|
@@ -29,11 +29,11 @@ def main ():
|
|
| 29 |
# ner = init_model_ner()
|
| 30 |
print("Loading data...")
|
| 31 |
start_loading = set_start()
|
| 32 |
-
st.audio(wav_audio_data, format='audio/wav')
|
| 33 |
original = transcribe(wav_audio_data, s2t)
|
| 34 |
-
st.write(f"
|
| 35 |
translation = translate(original)
|
| 36 |
-
st.write(f"
|
| 37 |
|
| 38 |
# if text is not None and ner is not None:
|
| 39 |
# st.write('Entities: ', get_entity_labels(model=ner, text=text))
|
|
|
|
| 12 |
print(f"Running main")
|
| 13 |
|
| 14 |
#print(subprocess.Popen('pip freeze > requirements_hug.txt', shell=True))
|
| 15 |
+
# original = "Tenho uma proposta para a Caixa Geral de Depositos, para 3 consultores Outsystems, 300 euros por dia e um periodo de seis meses."
|
| 16 |
+
# st.write(f"Original: {original}")
|
| 17 |
# traducao = get_translation(text_to_translate=text, languageCode="pt")
|
| 18 |
# st.write(traducao)
|
| 19 |
|
| 20 |
+
# translation = translate(original)
|
| 21 |
+
# st.write(f"Translation: {translation}")
|
| 22 |
print("Rendering UI...")
|
| 23 |
start_render = set_start()
|
| 24 |
wav_audio_data = st_audiorec()
|
|
|
|
| 29 |
# ner = init_model_ner()
|
| 30 |
print("Loading data...")
|
| 31 |
start_loading = set_start()
|
| 32 |
+
#st.audio(wav_audio_data, format='audio/wav')
|
| 33 |
original = transcribe(wav_audio_data, s2t)
|
| 34 |
+
st.write(f"Transcription: {original}")
|
| 35 |
translation = translate(original)
|
| 36 |
+
st.write(f"Translation: {translation}")
|
| 37 |
|
| 38 |
# if text is not None and ner is not None:
|
| 39 |
# st.write('Entities: ', get_entity_labels(model=ner, text=text))
|