Mahiruoshi commited on
Commit
b8be8ba
1 Parent(s): e836cae

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +5 -4
main.py CHANGED
@@ -49,8 +49,8 @@ class VitsGradio:
49
  with gr.Column():
50
  with gr.Row():
51
  with gr.Column():
52
- self.api_input1 = gr.TextArea(label="输入gpt/茉莉云的api-key或本地存储说话模型的路径.如果要用茉莉云则用'|'隔开key和密码", value="49eig5nu3rllvg6e|itcn9760")
53
- with gr.Accordion(label="chatbot选择(默认gpt3.5)", open=False):
54
  self.api_input2 = gr.Checkbox(value=False, label="茉莉云")
55
  self.local_chat1 = gr.Checkbox(value=False, label="启动本地chatbot")
56
  self.local_chat2 = gr.Checkbox(value=False, label="是否量化")
@@ -231,12 +231,13 @@ class VitsGradio:
231
 
232
 
233
  def tts_fn(self,text):
 
234
  if self.local_chat1:
235
  text = self.mori(text)
236
  elif self.api_input2:
237
  text = self.ChATGLM(text)
238
- else:
239
- text = text = self.chatgpt(text)
240
  print(text)
241
  text =self.sle(self.language,text)
242
  with torch.no_grad():
 
49
  with gr.Column():
50
  with gr.Row():
51
  with gr.Column():
52
+ self.api_input1 = gr.TextArea(label="输入gpt/茉莉云的api-key或本地存储说话模型的路径.如果要用茉莉云则用'|'隔开key和密码", value="sample:49eig5nu3rllvg6e|itcn9760")
53
+ with gr.Accordion(label="chatbot选择(默认gpt3.5),如需启用其他功能,请删除234行的注释", open=False):
54
  self.api_input2 = gr.Checkbox(value=False, label="茉莉云")
55
  self.local_chat1 = gr.Checkbox(value=False, label="启动本地chatbot")
56
  self.local_chat2 = gr.Checkbox(value=False, label="是否量化")
 
231
 
232
 
233
  def tts_fn(self,text):
234
+ '''
235
  if self.local_chat1:
236
  text = self.mori(text)
237
  elif self.api_input2:
238
  text = self.ChATGLM(text)
239
+ '''
240
+ text = text = self.chatgpt(text)
241
  print(text)
242
  text =self.sle(self.language,text)
243
  with torch.no_grad():