yuangongfdu commited on
Commit
f2beb7c
1 Parent(s): 344393e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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-titan-7.csail.mit.edu:8080/upload/', files={'audio_file': audio_file})
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-titan-7.csail.mit.edu:8080/items/0', json={
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-9.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-9.csail.mit.edu:8080/items/0', json={
39
  'audio_path': audio_path, 'question': question
40
  })
41
  answer = json.loads(response.content)