Ailyth commited on
Commit
a943d2c
1 Parent(s): aa95d38

fix lang type

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -606,15 +606,15 @@ def lang_detector(text):
606
  try:
607
  detector = Detector(text).language
608
  lang_info = str(detector)
609
- code = re.search(r"code: (\w+)", lang_info).group(1)
610
- if code == 'ja':
611
  return "日本語"
612
- elif code == 'zh':
613
  return "中文"
614
- elif code == 'en':
615
  return 'English'
616
  else:
617
- return re.search(r"name: (\w+)", lang_info).group(1)
618
  except Exception as e:
619
  return f"ERROR:{str(e)}"
620
 
@@ -756,9 +756,9 @@ with gr.Blocks(theme='Kasien/ali_theme_custom') as app:
756
  If you like this space, please click the ❤️ at the top of the page..如喜欢,请点一下页面顶部的❤️<br>
757
  </p>''')
758
 
759
- gr.Markdown("""* This space is based on the text-to-speech generation solution GPT-SoVITS .
760
  You can visit the repo's github homepage to learn training and inference.<br>
761
- 本空间基于文字转语音生成方案 GPT-SoVITS . 你可以前往项目的github主页学习如何推理和训练。
762
  * ⚠️Generating voice is very slow due to using HuggingFace's free CPU in this space.
763
  For faster generation, click the Colab icon below to use this space in Colab,
764
  which will significantly improve the speed.<br>
 
606
  try:
607
  detector = Detector(text).language
608
  lang_info = str(detector)
609
+ code = re.search(r"name: (\w+)", lang_info).group(1)
610
+ if code == 'Japanese':
611
  return "日本語"
612
+ elif code == 'Chinese':
613
  return "中文"
614
+ elif code == 'English':
615
  return 'English'
616
  else:
617
+ return code
618
  except Exception as e:
619
  return f"ERROR:{str(e)}"
620
 
 
756
  If you like this space, please click the ❤️ at the top of the page..如喜欢,请点一下页面顶部的❤️<br>
757
  </p>''')
758
 
759
+ gr.Markdown("""* This space is based on the text-to-speech generation solution [GPT-SoVITS](https://github.com/RVC-Boss/GPT-SoVITS) .
760
  You can visit the repo's github homepage to learn training and inference.<br>
761
+ 本空间基于文字转语音生成方案[GPT-SoVITS](https://github.com/RVC-Boss/GPT-SoVITS) . 你可以前往项目的github主页学习如何推理和训练。
762
  * ⚠️Generating voice is very slow due to using HuggingFace's free CPU in this space.
763
  For faster generation, click the Colab icon below to use this space in Colab,
764
  which will significantly improve the speed.<br>