Python Code is Failing

Code crashes and I don’t know why. Here’s a link to the crash:
https://www.gumloop.com/pipeline?workbook_id=2kZ2N9FUjopd1nJohYXXPt&run_id=3J6fQ9g3yae9EJW6rzUvzA

Here’s the code:
def function(audio_file):

import librosa
y, sr = librosa.load(audio_file)
tempo, beat_frames = librosa.beat.beat_track(y=y, sr=sr)

return beat_frames, tempo

Hey @stevetrang! If you’re reporting an issue with a flow or an error in a run, please include the run link and make sure it’s shareable so we can take a look.

  1. Find your run link on the history page. Format: https://www.gumloop.com/pipeline?run_id={your_run_id}&workbook_id={workbook_id}

  2. Make it shareable by clicking “Share” → ‘Anyone with the link can view’ in the top-left corner of the flow screen.
    GIF guide

  3. Provide details about the issue—more context helps us troubleshoot faster.

You can find your run history here: https://www.gumloop.com/history

https://www.gumloop.com/pipeline?workbook_id=2kZ2N9FUjopd1nJohYXXPt&run_id=3J6fQ9g3yae9EJW6rzUvzA

Hey @stevetrang - This is the full error message:
'utf-8' codec can't decode bytes in position 32766-32767: unexpected end of data

The API response which is being passed onto the Run Code node is the binary audio file (you can click view inputs/outputs of the node from the run log to see the complete input. https://docs.gumloop.com/core-concepts/run_log)

If you want to send the actual file object to a Run Code or Custom Node then the file must be present on the Gumloop’s working directory and you can reference it via file name.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.