Browse Source

change test env from get to post

ming 3 năm trước cách đây
mục cha
commit
25501e5fdf
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      api/main.py

+ 3 - 1
api/main.py

@@ -680,7 +680,7 @@ def call_voice(text):
     c = rpyc.connect("localhost", 8868)
     c = rpyc.connect("localhost", 8868)
     c._config['sync_request_timeout'] = None
     c._config['sync_request_timeout'] = None
     remote_svc = c.root
     remote_svc = c.root
-    my_answer = remote_svc.call_avatar(text) # method call
+    my_answer = remote_svc.make_speech(text) # method call
     src_path = '/home/ming/AI_Anchor/OpenshotService/speech.mp3'
     src_path = '/home/ming/AI_Anchor/OpenshotService/speech.mp3'
     shutil.copy(src_path,'/home/ming/speech.mp3')
     shutil.copy(src_path,'/home/ming/speech.mp3')
     os.remove(src_path)
     os.remove(src_path)
@@ -689,6 +689,8 @@ class text_in(BaseModel):
     text: str
     text: str
 @app.post("/make_voice")
 @app.post("/make_voice")
 async def make_voice(in_text:text_in):
 async def make_voice(in_text:text_in):
+    print(in_text.text)
+    print(len(in_text.text))
     x = threading.Thread(target=call_voice, args=(in_text.text))
     x = threading.Thread(target=call_voice, args=(in_text.text))
     x.start()
     x.start()