youngtsai commited on
Commit
86fcb4f
·
1 Parent(s): 7f75261

'audio_file': (os.path.basename(audio), f, 'audio/wav')

Browse files
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -35,18 +35,18 @@ def score_audio_plus(password, audio, api_plan, return_json):
35
  }
36
 
37
  # Prepare files and data for POST request
38
- with open(audio, "rb") as audio_file:
39
  files = {
40
- 'audio_file': audio_file
41
  }
42
-
43
- data = {
44
- 'api_plan': api_plan,
45
- 'return_json': "true" if return_json else "false"
46
- }
47
-
48
- # Send POST request
49
- response = requests.post(url, files=files, data=data, headers=headers)
50
 
51
  if response.status_code == 200:
52
  # Successfully made the request
 
35
  }
36
 
37
  # Prepare files and data for POST request
38
+ with open(audio, "rb") as f:
39
  files = {
40
+ 'audio_file': (os.path.basename(audio), f, 'audio/wav')
41
  }
42
+ data = {
43
+ 'api_plan': api_plan,
44
+ 'return_json': "true" if return_json else "false"
45
+ }
46
+
47
+ # Send POST request
48
+ response = requests.post(url, files=files, data=data, headers=headers)
49
+
50
 
51
  if response.status_code == 200:
52
  # Successfully made the request