Spaces:
Runtime error
Runtime error
yuangongfdu
commited on
Commit
•
37a446d
1
Parent(s):
838e208
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:
|
@@ -52,7 +52,7 @@ def predict(audio_path_m, audio_path_t, question, model):
|
|
52 |
if question == '':
|
53 |
return 'Please ask a question.'
|
54 |
print(audio_path, question)
|
55 |
-
response = requests.put('http://sls-
|
56 |
'audio_path': audio_path, 'question': question
|
57 |
})
|
58 |
answer_7b = 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-5.csail.mit.edu:8080/upload/', files={'audio_file': audio_file})
|
24 |
if response.status_code == 200:
|
25 |
return response.json()["path"]
|
26 |
except:
|
|
|
52 |
if question == '':
|
53 |
return 'Please ask a question.'
|
54 |
print(audio_path, question)
|
55 |
+
response = requests.put('http://sls-titan-5.csail.mit.edu:8080/items/0', json={
|
56 |
'audio_path': audio_path, 'question': question
|
57 |
})
|
58 |
answer_7b = json.loads(response.content)
|