Spaces:
Running
Running
yuangongfdu
commited on
Commit
•
a949467
1
Parent(s):
1965418
Update app.py
Browse files
app.py
CHANGED
@@ -32,7 +32,7 @@ def upload_audio_13b(audio_path):
|
|
32 |
if size == True:
|
33 |
return 'size'
|
34 |
with open(audio_path, 'rb') as audio_file:
|
35 |
-
response = requests.post('http://sls-titan-
|
36 |
if response.status_code == 200:
|
37 |
return response.json()["path"]
|
38 |
except:
|
@@ -68,7 +68,7 @@ def predict(audio_path_m, audio_path_t, question, model):
|
|
68 |
if question == '':
|
69 |
return 'Please ask a question.'
|
70 |
print(audio_path, question)
|
71 |
-
response = requests.put('http://sls-titan-
|
72 |
'audio_path': audio_path, 'question': question
|
73 |
})
|
74 |
answer_13b = json.loads(response.content)
|
|
|
32 |
if size == True:
|
33 |
return 'size'
|
34 |
with open(audio_path, 'rb') as audio_file:
|
35 |
+
response = requests.post('http://sls-titan-7.csail.mit.edu:8080/upload/', files={'audio_file': audio_file})
|
36 |
if response.status_code == 200:
|
37 |
return response.json()["path"]
|
38 |
except:
|
|
|
68 |
if question == '':
|
69 |
return 'Please ask a question.'
|
70 |
print(audio_path, question)
|
71 |
+
response = requests.put('http://sls-titan-7.csail.mit.edu:8080/items/0', json={
|
72 |
'audio_path': audio_path, 'question': question
|
73 |
})
|
74 |
answer_13b = json.loads(response.content)
|