Spaces:
Runtime error
Runtime error
yuangongfdu
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -20,7 +20,7 @@ def upload_audio(audio_path):
|
|
20 |
if size == True:
|
21 |
return 'size'
|
22 |
with open(audio_path, 'rb') as audio_file:
|
23 |
-
response = requests.post('http://sls-
|
24 |
if response.status_code == 200:
|
25 |
return response.json()["path"]
|
26 |
except:
|
@@ -35,7 +35,7 @@ def predict(audio_path, question):
|
|
35 |
if question == '':
|
36 |
return 'Please ask a question.'
|
37 |
print(audio_path, question)
|
38 |
-
response = requests.put('http://sls-
|
39 |
'audio_path': audio_path, 'question': question
|
40 |
})
|
41 |
answer = json.loads(response.content)
|
|
|
20 |
if size == True:
|
21 |
return 'size'
|
22 |
with open(audio_path, 'rb') as audio_file:
|
23 |
+
response = requests.post('http://sls-titan-8.csail.mit.edu:8080/upload/', files={'audio_file': audio_file})
|
24 |
if response.status_code == 200:
|
25 |
return response.json()["path"]
|
26 |
except:
|
|
|
35 |
if question == '':
|
36 |
return 'Please ask a question.'
|
37 |
print(audio_path, question)
|
38 |
+
response = requests.put('http://sls-titan-8.csail.mit.edu:8080/items/0', json={
|
39 |
'audio_path': audio_path, 'question': question
|
40 |
})
|
41 |
answer = json.loads(response.content)
|