GithubHelp home page GithubHelp logo

Comments (13)

dvonthenen avatar dvonthenen commented on June 19, 2024 1

yea, there isn't a timeout parameter in the transcription options class. it's on the function:
https://github.com/deepgram/deepgram-python-sdk/blob/main/deepgram/clients/abstract_sync_client.py#L91-L105

For transcribe_file (URL is the same way):

myTimeout = httpx.Timeout(30.0, connect=10.0)
response = deepgram.listen.prerecorded.v("1").transcribe_file(payload, options, timeout=myTimeout)

from deepgram-python-sdk.

SandraRodgers avatar SandraRodgers commented on June 19, 2024

Hi @swethmandava ,

I've just tested this using the Python SDK and I didn't encounter a problem. Can you verify that you were using this Python SDK to make the request? I tested it using the prerecorded example file in the examples folder of this project.

from deepgram-python-sdk.

swethmandava avatar swethmandava commented on June 19, 2024
deepgram.transcription.prerecorded(
        source,
        options,
       timeout = 300
    )

Increasing timeout fixes the issue.

from deepgram-python-sdk.

swethmandava avatar swethmandava commented on June 19, 2024

even without timeout = 3000, it fails sometimes for videos of length < 1 hr. what do you recommend?

from deepgram-python-sdk.

jpvajda avatar jpvajda commented on June 19, 2024

@swethmandava timeouts can happen for a lot of reasons but it might all come down to the file size of what you are trying to send to us to transcribe.

so I'd recommend setting the timeout value to 300 seconds (5 minutes) when making a request to Deepgram.

Also I noticed you used our video model which part of our Base tier, you can try a few different tier model combinations to see if it performs better. Our newest Nova models are the fastest, so I recommend trying that depending on the language needs of the file.

Here are some Docs that can help you determine a model:

https://developers.deepgram.com/docs/model
https://developers.deepgram.com/docs/models-overview

from deepgram-python-sdk.

swethmandava avatar swethmandava commented on June 19, 2024

I still get timeout errors occasionally. What's the recommended way to retry / upload large files without timeouts?

from deepgram-python-sdk.

dvonthenen avatar dvonthenen commented on June 19, 2024

I still get timeout errors occasionally. What's the recommended way to retry / upload large files without timeouts?

The best way of you are dealing with potential unstable internet connections would be to upload to some publicly accessible S3 bucket and use the transcription via URL method.

https://developers.deepgram.com/reference/pre-recorded

from deepgram-python-sdk.

JoelLederman avatar JoelLederman commented on June 19, 2024

I am trying to transcribe an mp3 on my computer of about 1 hour and a half and it keeps timing out. I trying using the parameter timeout = 300 but it said this was invalid syntax. Does anyone know how to fix this?

from deepgram-python-sdk.

dvonthenen avatar dvonthenen commented on June 19, 2024

I am trying to transcribe an mp3 on my computer of about 1 hour and a half and it keeps timing out. I trying using the parameter timeout = 300 but it said this was invalid syntax. Does anyone know how to fix this?

@JoelLederman It's probably because the syntax is invalid (the parameter you are using is not valid). Can you post your code OR how you are calling the function with the parameter declarations here?

from deepgram-python-sdk.

JoelLederman avatar JoelLederman commented on June 19, 2024

This is the part of the code that I specify timeout settings:
options = PrerecordedOptions(
model="nova",
smart_format=True,
summarize="v2",
diarize=True,
timeout = 300
)

from deepgram-python-sdk.

JoelLederman avatar JoelLederman commented on June 19, 2024

Ok that worked thanks so much!
Just one more question, the output I get is in this format: =2, speaker_confidence=0.7495117), Word(word='be', start=4066.395, end=4066.635, confidence=1.0, punctuated_word='be', speaker=2, speaker_confidence=0.7495117).
Is there any way to just get the transcription out as if I was using the API playground. I just want a transcription with speaker diarization as my output.

from deepgram-python-sdk.

dvonthenen avatar dvonthenen commented on June 19, 2024

I would understand how dot notation works. Here is an article:
https://builtin.com/data-science/dot-notation#:~:text=Dot%20Notation%20Explained,dot%5D%5Battribute%20or%20method%5D%20.

The structure for what the prerecorded result looks like is here:
https://github.com/deepgram/deepgram-python-sdk/blob/main/deepgram/clients/prerecorded/v1/response.py

The Prerecorded Object is VASTLY different from the Live Response object, but it might give you a clue on how you want to format your transcription and how to use the dot notation:
https://github.com/deepgram/deepgram-python-sdk/blob/main/examples/streaming/microphone/main.py#L34-L37

from deepgram-python-sdk.

JoelLederman avatar JoelLederman commented on June 19, 2024

Ok thanks so much you have been an amazing help!

from deepgram-python-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.