liqian 2 年之前
父节点
当前提交
f45d2b8d16
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      gpt_process.py

+ 4 - 1
gpt_process.py

@@ -1,5 +1,6 @@
 import time
 import requests
+import json
 import traceback
 from utils import download_video
 from audio_process import get_wav
@@ -34,7 +35,9 @@ def request_gpt(prompt):
     # print(response.json())
     # print(response.json()['choices'][0]['message']['content'])
     # print('\n')
-    result_content = response.json()['choices'][0]['message']['content']
+    # result_content = response.json()['choices'][0]['message']['content']
+    res_data = json.loads(response.text)
+    result_content = res_data['choices'][0]['message']['content']
     return result_content