ageraustine commited on
Commit
6f9fc8e
1 Parent(s): 01fc4a7

response jsonify

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -76,8 +76,9 @@ if st.button("Generate Audio") and genre and energy_level and description and te
76
  payload = {"inputs": {"prompt": prompt, "duration": duration, "track": audio_base64}}
77
  st.text("Generating audio...")
78
  response = requests.post(API_URL, headers=headers, json=payload)
79
- st_state.audio = np.array(response.json()[0]['generated_audio'], dtype=np.float32)
80
- sample_rate = response.json()[0]['sample_rate']
 
81
  st.audio(st_state.audio, format="audio/wav", sample_rate=sample_rate, start_time=0)
82
 
83
  # Post-processing options
 
76
  payload = {"inputs": {"prompt": prompt, "duration": duration, "track": audio_base64}}
77
  st.text("Generating audio...")
78
  response = requests.post(API_URL, headers=headers, json=payload)
79
+ response = response.json()[0]
80
+ st_state.audio = np.array(response['generated_audio'], dtype=np.float32)
81
+ sample_rate = response['sample_rate']
82
  st.audio(st_state.audio, format="audio/wav", sample_rate=sample_rate, start_time=0)
83
 
84
  # Post-processing options