Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -9,6 +9,7 @@ import telnetlib
|
|
9 |
whisper = gr.Interface.load(name="spaces/sanchit-gandhi/whisper-large-v2")
|
10 |
#chatgpt = gr.Blocks.load(name="spaces/fffiloni/whisper-to-chatGPT")
|
11 |
import os
|
|
|
12 |
import requests
|
13 |
#session_token = os.environ.get('SessionToken')
|
14 |
# ChatGPT
|
@@ -53,10 +54,9 @@ def chat_hf(audio, custom_token, language):
|
|
53 |
else:
|
54 |
data = {"content": whisper_text}
|
55 |
print(data)
|
56 |
-
detect_port('93.56.204.222', 7788)
|
57 |
#res = requests.get('http://myip.ipip.net', timeout=5).text
|
58 |
#print(res)
|
59 |
-
response = requests.post('http://93.56.204.222:7788/api/ask', headers=headers, json
|
60 |
print('this is my answear', response.text)
|
61 |
chat_id['parent_id'] = response.json()["response_id"]
|
62 |
chat_id['conversation_id'] = response.json()["conversation_id"]
|
|
|
9 |
whisper = gr.Interface.load(name="spaces/sanchit-gandhi/whisper-large-v2")
|
10 |
#chatgpt = gr.Blocks.load(name="spaces/fffiloni/whisper-to-chatGPT")
|
11 |
import os
|
12 |
+
import json
|
13 |
import requests
|
14 |
#session_token = os.environ.get('SessionToken')
|
15 |
# ChatGPT
|
|
|
54 |
else:
|
55 |
data = {"content": whisper_text}
|
56 |
print(data)
|
|
|
57 |
#res = requests.get('http://myip.ipip.net', timeout=5).text
|
58 |
#print(res)
|
59 |
+
response = requests.post('http://93.56.204.222:7788/api/ask', headers=headers, data=json.dumps(data))
|
60 |
print('this is my answear', response.text)
|
61 |
chat_id['parent_id'] = response.json()["response_id"]
|
62 |
chat_id['conversation_id'] = response.json()["conversation_id"]
|