maolin.liu
commited on
Commit
·
c08591d
1
Parent(s):
d057131
[feature]Add log info.
Browse files- consumer/asr.py +2 -0
consumer/asr.py
CHANGED
|
@@ -106,11 +106,13 @@ class TranscribeConsumer(BasicMessageReceiver):
|
|
| 106 |
if validated_message.using_file_content:
|
| 107 |
audio_file = io.BytesIO(base64.b64decode(validated_message.audio_file))
|
| 108 |
|
|
|
|
| 109 |
segments, _ = self.asr_model.transcribe(audio_file, language=validated_message.language)
|
| 110 |
|
| 111 |
transcribed_text = ''
|
| 112 |
for segment in segments:
|
| 113 |
transcribed_text = segment.text
|
|
|
|
| 114 |
break
|
| 115 |
except ValidationError as exc:
|
| 116 |
logging.exception('Message validated failed: \n message:\n %s\n\n exception info:\n %s', message, exc)
|
|
|
|
| 106 |
if validated_message.using_file_content:
|
| 107 |
audio_file = io.BytesIO(base64.b64decode(validated_message.audio_file))
|
| 108 |
|
| 109 |
+
logger.info(f'Start transcribe input...')
|
| 110 |
segments, _ = self.asr_model.transcribe(audio_file, language=validated_message.language)
|
| 111 |
|
| 112 |
transcribed_text = ''
|
| 113 |
for segment in segments:
|
| 114 |
transcribed_text = segment.text
|
| 115 |
+
logger.info(f'Transcribed text: {transcribed_text}')
|
| 116 |
break
|
| 117 |
except ValidationError as exc:
|
| 118 |
logging.exception('Message validated failed: \n message:\n %s\n\n exception info:\n %s', message, exc)
|