#The thingy

26 messages ยท Page 1 of 1 (latest)

ionic moon
worthy lark
#

you left your api key in there

ionic moon
#

I thought I xxx'd it

worthy lark
#

nope ๐Ÿ˜„

ionic moon
#

oh I did the chat gpt one

#

okay that's clean. I didn't mean to paste it all as text before.

worthy lark
#

I can skim the openai calls but don't expect a full lookover as I'm about to go to bed

ionic moon
#

my friend, I expect nothing

#

it's 11 at night where I am and I'm old

worthy lark
#

What's the file size of the podcasts your transcribing?

ionic moon
#

Well this PARTICULAR one is 1-hour

#

usually only 10-15mins

#

I do 7 a week, 3 are an hour long.

worthy lark
#

If the file is larger than 25mb you'll need to split it into segments < 25mb

ionic moon
#

oh that's interesting... why? That's a limitation of the transcription service? I wonder if I should just use deepgram.

worthy lark
#

that's just how they setup the api, probably something to do with preventing abuse? If you run the whisper model locally you have no such issue

ionic moon
#

I'll swap out the transcription to Deepgram, maybe that will solve my problem. Go to bed, thanks for the idea, I'll update the thread and let you know what happens.

#

I appreciate the look over.

worthy lark
#

gimmie a sec to actually put the changes here :P

ionic moon
#

oh sure! Sorry thought you were trying to get to sleep!

worthy lark
#
      openai.api_key = os.getenv("OPENAI_API_KEY")

    # Transcribe the audio using OpenAI's GPT-3 language model
    audio_file = open("latest_episode.mp3", "rb")

    audio_type = "audio/mpeg"
    audio_filename = "latest_episode.mp3"
    transcript_result = openai.Audio.transcribe("whisper-1", audio_file)
    # Clean up the transcription text

I don't remember what the object for transcript_result is off memory, it'll be on the docs though

#

the comments map to the ones in your code so you know what to replace

#

The indentation is very off since the txt didn't open in a code editor, code should be fine though

    # Set up ChatGPT API credentials
completion = openai.ChatCompletion.create(
  model="gpt-3.5-turbo",
  messages=[
    {"role": "user", "content": "Generate an approximately 800-word blog post based on the following transcription:\n\n" + transcription + "\n\nBlog post:"}
  ]
)

    # Extract the blog post text from the response
    blog_post = completion.choices[0].message
ionic moon
#

Thank you. Incredibly useful. Appreciate it!

#

I'll let you know how it goes.