TomFrankly / pipedream-notion-voice-notes

Take notes with your voice and send them to Notion
103 stars 55 forks source link

Transcribing chunck fail #63

Closed PrimalSYS closed 8 months ago

PrimalSYS commented 8 months ago

Describe the bug A clear and concise description of what the bug is. Consistent fail while proccessing the file with Open AI. have run this multiple times with the same error Which cloud storage app are you using? (Google Drive, Dropbox, or OneDrive) GD

Have you tried updating your workflow? I just installed from your website today so I assume it's current Please follow the steps here, and ensure you've tested the latest version of the workflow: https://thomasjfrank.com/how-to-transcribe-audio-to-text-with-chatgpt-and-notion/#update there is no update available on that step "notion_voice_notes"

Does the issue only happen while testing the workflow, or does it happen during normal, automated runs? It Happens on both. after several try's in test mode I depoyed and still have the same issue. Please paste the contents of your Logs tab from the notion_voice_notes action step. 1/23/2024, 2:53:00 PM Checking that file is under 300mb...

1/23/2024, 2:53:00 PM File size is approximately 0.1mb.

1/23/2024, 2:53:00 PM File is under the size limit. Continuing...

1/23/2024, 2:53:00 PM Checking if the user set languages...

1/23/2024, 2:53:00 PM No language set. Whisper will attempt to detect the language.

1/23/2024, 2:53:00 PM Successfully got duration: 6 seconds

1/23/2024, 2:53:00 PM Chunking file: /tmp/1-23 notion test.m4a

1/23/2024, 2:53:00 PM Chunks created successfully. Transcribing chunks: chunk-000.m4a

1/23/2024, 2:53:00 PM Transcribing file: chunk-000.m4a

1/23/2024, 2:54:29 PM Attempting to clean up the /tmp/ directory...

1/23/2024, 2:54:29 PM Cleaning up /tmp/chunks-2bNL1tPYI9bEOx8z7BaCHJklK5e...

1/23/2024, 2:54:29 PM ACTIVE_HANDLE This step was still trying to run code when the step ended. Make sure you promisify callb

TomFrankly commented 8 months ago

Hey @PrimalSYS,

Did the red error box say "Connection Error"?

If so, you can try this fix: https://thomasjfrank.com/how-to-transcribe-audio-to-text-with-chatgpt-and-notion/#openai-error

However, this doesn't always work. Apparently OpenAI has been pretty spotty lately with connection errors on their side, and unfortuantely they don't provide any extra info in the error message when this type of error happens.

If you've already tried the fix I linked above, and have made sure your workflow is up-to-date, then you may just have to come back and try again later.

Back in November, they actually had to pause signups for a bit: https://www.theverge.com/2023/11/15/23962003/openai-pumps-the-breaks-on-chatgpt-plus-signups

I believe they've unpaused them, but they're still facing heavy demands on their servers.

PrimalSYS commented 8 months ago

Error An error occured while attempting to split the file into chunks, or while sending the chunks to OpenAI. If the full error below says "Unidentified connection error", please double-check that you have entered valid billing info in your OpenAI account. Afterward, generate a new API key and enter it in the OpenAI app here in Pipedream. Then, try running the workflow again. If that does not work, please open an issue at this workflow's Github repo: https://github.com/TomFrankly/pipedream-notion-voice-notes/issues Full error from OpenAI: Connection error. at Object.chunkFileAndTranscribe (file:///pipedream/dist/code/4cf355a52ab0f9c275ba953eea42492276c4b796f961fdffefa87942b1ced4df/code/Notion-Voice-Notes.mjs:391:11) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at Object.run (file:///pipedream/dist/code/4cf355a52ab0f9c275ba953eea42492276c4b796f961fdffefa87942b1ced4df/code/Notion-Voice-Notes.mjs:1901:22) at null.executeComponent (/var/task/launch_worker.js:286:22) at MessagePort.messageHandler (/var/task/launch_worker.js:783:28)

PrimalSYS commented 8 months ago

I have had my account at OAI for 11 months now and use it several times a week so I know the billing is up to date. I previously generated the API key with the same results before I posted here.

TomFrankly commented 8 months ago

@PrimalSYS yep, sadly that's the connection error. It's different from the other errors their API would send; all the others have typical status codes that indicate a specific problem. This one is just "unidentified connection error" and it doesn't carry any other information.

I think it's just their servers being overloaded and rejecting the connection, but it's hard to know for sure. It's possible that it's also an issue specifically with their transcription endpoint.

Just to check: Are you using an API you know was generated after you added or last updated your billing info? We've seen other people affected by an undocumented bug on their end; API keys made during the trial period stop working once they add billing info.

Another thing we can test – if you try the same API key at https://www.typingmind.com/, does it work? And if so, does it still fail for Notion Voice Notes?

If so, it could indicate that the issue has to do with their speech-to-text endpoint, or something else, such as Pipedream's set of IP addresses.

Sorry this is such a tough one to debug! I haven't seen it a single time on my own API key.

PrimalSYS commented 8 months ago

I am going to let this sit for a while. I have production items I have to attend to the rest of the week. But I wanted to quickly share with you results from a quick test I just ran directly in GPT4. I dropped the audio file with a quick prompt.. Here's what happened. OAI must be in the midst of an internal serve issue as you surmised.

https://chat.openai.com/share/cd2823b3-0398-4b28-9c01-7f68da043367

On Thu, Jan 25, 2024 at 1:52 PM Thomas Frank @.***> wrote:

@PrimalSYS https://github.com/PrimalSYS yep, sadly that's the connection error. It's different from the other errors their API would send; all the others have typical status codes that indicate a specific problem. This one is just "unidentified connection error" and it doesn't carry any other information.

I think it's just their servers being overloaded and rejecting the connection, but it's hard to know for sure. It's possible that it's also an issue specifically with their transcription endpoint.

Just to check: Are you using an API you know was generated after you added or last updated your billing info? We've seen other people affected by an undocumented bug on their end; API keys made during the trial period stop working once they add billing info.

Another thing we can test – if you try the same API key at https://www.typingmind.com/, does it work? And if so, does it still fail for Notion Voice Notes?

If so, it could indicate that the issue has to do with their speech-to-text endpoint, or something else, such as Pipedream's set of IP addresses.

Sorry this is such a tough one to debug! I haven't seen it a single time on my own API key.

— Reply to this email directly, view it on GitHub https://github.com/TomFrankly/pipedream-notion-voice-notes/issues/63#issuecomment-1911057013, or unsubscribe https://github.com/notifications/unsubscribe-auth/BFR7CZRAWS7VDB4QLYTIZI3YQLHYTAVCNFSM6AAAAABCHZ7FR2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJRGA2TOMBRGM . You are receiving this because you were mentioned.Message ID: @.***>

-- [image: photo]

Brian McGee Founder, Primal Systems LLC

310-710-1213 | Primalsystemsllc.com

@.*** | Ventura, CA https://maps.google.com/?q=Ventura,+CA Create your WiseStamp email signature https://www.wisestamp.com/lp/promo/professional-email-signature?utm_source=promotion&utm_medium=signature&utm_campaign=create_your_own&srcid=

[image: tpx]

TomFrankly commented 8 months ago

@PrimalSYS man, this is frustrating. I wish I could replicate this bug!

I just created a brand-new Pipedream account along with a brand-new API key at OpenAI (key is now revoked after recording this). I went through the same workflow set up again, without any issues: https://www.loom.com/share/e89a7fc8a7844b488c224725ed98dd6f?sid=c61d44ed-7e56-4f0b-8e4c-e9f7311c11e1

One thing I'll note: I don't believe the actual ChatGPT website that you linked above can use the speech-to-text service. I think that only works via the OpenAI API, which is part of the reason this workflow is so useful.

That does bring up a question: Do you have billing info set here? https://platform.openai.com/account/billing/overview

This is a separate billing area from the one you use for ChatGPT Plus, which is the service you linked above. That version of ChatGPT (https://chat.openai.com/) is pretty much entirely separate in terms of billing from the API we're using in this workflow.

PrimalSYS commented 8 months ago

well, I think we're almost there. It transcribes the voice file. I had to go with a different app for recording b/c it didn't like mp4 from Samsung's native recording app. But it won't go into Notion. Now the only two variables that I know of in your set are seconds & AI cost. Below are three pieces of info from this latest attempt. Error, Details, Log

Error Invalid duration number (thrown from calculateTranscriptCost).

DETAILS at Object.calculateTranscriptCost (file:///tmp/pdg/dist/code/f124a850c3f703097b5494bd1efc77777c2efa4db1b6462c7952f47e82001a2f/code/Notion-Voice-Notes.mjs:1219:11) at Object.run (file:///tmp/pdg/dist/code/f124a850c3f703097b5494bd1efc77777c2efa4db1b6462c7952f47e82001a2f/code/Notion-Voice-Notes.mjs:2056:41) at null.executeComponent (/var/task/launch_worker.js:286:22) at MessagePort.messageHandler (/var/task/launch_worker.js:783:28)

Summary Options [ "Summary", "Main Points", "Action Items", "References" ] Notes Database All Notes [UBCC] – (used for Ultimate Brain) 5c7ed7a5-db9e-43bc-849c-97a97a6a8c15 Note Title (Required) Title Note Duration Duration (Seconds) Note Cost AI Cost Note Page Icon 🤖 ChatGPT Model gpt-3.5-turbo Enable Advanced Options false

Test

LOG: 1/25/2024, 5:43:56 PM No space found or hard limit reached in element, splitting at 279. Transcript chunk is as follows: Corporate identity logo standards are developed to ensure a consistent and unified image that maximizes brand equity, impacts marketing efforts, and communicates corporate vision and principles clearly. A unified corporate voice is more powerful and lasting than a dissonant one.

Test

TomFrankly commented 8 months ago

@PrimalSYS alright, just shipped an update to the last step in the workflow that should fix this.

It's happening because the voice notes app you're using is creating audio files that can't be read by the duration-calculation function I'm using in the workflow.

The new update will just set duration to 0 if this happens, which will make the AI Cost inaccurate but won't make the workflow fail.

If you'd rather have the workflow fail still, I've added a new option to the Advanced Settings that you can set to true so it does.

You can update your workflow like so: https://thomasjfrank.com/how-to-transcribe-audio-to-text-with-chatgpt-and-notion/#update

PrimalSYS commented 8 months ago

Awesome, thanks for the update! I'll jump in on that when I get in tonight

On Fri, Jan 26, 2024, 3:14 PM Thomas Frank @.***> wrote:

@PrimalSYS https://github.com/PrimalSYS alright, just shipped an update to the last step in the workflow that should fix this.

It's happening because the voice notes app you're using is creating audio files that can't be read by the duration-calculation function I'm using in the workflow.

The new update will just set duration to 0 if this happens, which will make the AI Cost inaccurate but won't make the workflow fail.

If you'd rather have the workflow fail still, I've added a new option to the Advanced Settings that you can set to true so it does.

You can update your workflow like so: https://thomasjfrank.com/how-to-transcribe-audio-to-text-with-chatgpt-and-notion/#update

— Reply to this email directly, view it on GitHub https://github.com/TomFrankly/pipedream-notion-voice-notes/issues/63#issuecomment-1912815965, or unsubscribe https://github.com/notifications/unsubscribe-auth/BFR7CZVVIA7D34AKJHXBXKDYQQ2HFAVCNFSM6AAAAABCHZ7FR2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJSHAYTKOJWGU . You are receiving this because you were mentioned.Message ID: @.***>

PrimalSYS commented 8 months ago

You, my friend are a golden God. If you don't know that reference look it up.

On Fri, Jan 26, 2024, 3:19 PM Brian McGee @.***> wrote:

Awesome, thanks for the update! I'll jump in on that when I get in tonight

On Fri, Jan 26, 2024, 3:14 PM Thomas Frank @.***> wrote:

@PrimalSYS https://github.com/PrimalSYS alright, just shipped an update to the last step in the workflow that should fix this.

It's happening because the voice notes app you're using is creating audio files that can't be read by the duration-calculation function I'm using in the workflow.

The new update will just set duration to 0 if this happens, which will make the AI Cost inaccurate but won't make the workflow fail.

If you'd rather have the workflow fail still, I've added a new option to the Advanced Settings that you can set to true so it does.

You can update your workflow like so: https://thomasjfrank.com/how-to-transcribe-audio-to-text-with-chatgpt-and-notion/#update

— Reply to this email directly, view it on GitHub https://github.com/TomFrankly/pipedream-notion-voice-notes/issues/63#issuecomment-1912815965, or unsubscribe https://github.com/notifications/unsubscribe-auth/BFR7CZVVIA7D34AKJHXBXKDYQQ2HFAVCNFSM6AAAAABCHZ7FR2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJSHAYTKOJWGU . You are receiving this because you were mentioned.Message ID: @.***>

TomFrankly commented 8 months ago

So glad that worked for you! And it was an update I probably should have made anyway.