supermy commited on
Commit
16476dc
1 Parent(s): 44f5653

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -24,12 +24,12 @@ def transcribe(microphone, file_upload):
24
  warn_output = ""
25
  if (microphone is not None) and (file_upload is not None):
26
  warn_output = (
27
- "WARNING: You've uploaded an audio file and used the microphone. "
28
- "The recorded file from the microphone will be used and the uploaded audio will be discarded.\n"
29
  )
30
 
31
  elif (microphone is None) and (file_upload is None):
32
- return "ERROR: You have to either use the microphone or upload an audio file"
33
 
34
  file = microphone if microphone is not None else file_upload
35
 
@@ -71,8 +71,8 @@ mf_transcribe = gr.Interface(
71
  theme="huggingface",
72
  title="口译示例: 音频转录",
73
  description=(
74
- "Transcribe long-form microphone or audio inputs with the click of a button! Demo uses the the fine-tuned"
75
- f" checkpoint [{MODEL_NAME}](https://huggingface.co/{MODEL_NAME}) and 🤗 Transformers to transcribe audio files"
76
  " of arbitrary length."
77
  ),
78
  article=article,
@@ -85,9 +85,9 @@ yt_transcribe = gr.Interface(
85
  outputs=["html", "text"],
86
  layout="horizontal",
87
  theme="huggingface",
88
- title="口译示例: YouTube视频转录",
89
  description=(
90
- "Transcribe long-form YouTube videos with the click of a button! Demo uses the the fine-tuned checkpoint:"
91
  f" [{MODEL_NAME}](https://huggingface.co/{MODEL_NAME}) and 🤗 Transformers to transcribe audio files of"
92
  " arbitrary length."
93
  ),
 
24
  warn_output = ""
25
  if (microphone is not None) and (file_upload is not None):
26
  warn_output = (
27
+ "WARNING:上传一个音频文件或者使用麦克风录制. "
28
+ "使用麦克风录制音频文件丢弃上传的音频文件.\n"
29
  )
30
 
31
  elif (microphone is None) and (file_upload is None):
32
+ return "ERROR: 你必须使用麦克风录制或上传音频文件"
33
 
34
  file = microphone if microphone is not None else file_upload
35
 
 
71
  theme="huggingface",
72
  title="口译示例: 音频转录",
73
  description=(
74
+ "转录麦克风或上传的音频文件! 演示使用微调过的模型"
75
+ f" checkpoint [{MODEL_NAME}](https://huggingface.co/{MODEL_NAME}) and 🤗 转录音频文件"
76
  " of arbitrary length."
77
  ),
78
  article=article,
 
85
  outputs=["html", "text"],
86
  layout="horizontal",
87
  theme="huggingface",
88
+ title="口译示例: 视频转录",
89
  description=(
90
+ "转录上传的视频文件! 使用微调后的模型:"
91
  f" [{MODEL_NAME}](https://huggingface.co/{MODEL_NAME}) and 🤗 Transformers to transcribe audio files of"
92
  " arbitrary length."
93
  ),