#The thingy
26 messages ยท Page 1 of 1 (latest)
you left your api key in there
I thought I xxx'd it
nope ๐
oh I did the chat gpt one
okay that's clean. I didn't mean to paste it all as text before.
I can skim the openai calls but don't expect a full lookover as I'm about to go to bed
What's the file size of the podcasts your transcribing?
Well this PARTICULAR one is 1-hour
usually only 10-15mins
I do 7 a week, 3 are an hour long.
If the file is larger than 25mb you'll need to split it into segments < 25mb
oh that's interesting... why? That's a limitation of the transcription service? I wonder if I should just use deepgram.
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
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.
gimmie a sec to actually put the changes here :P
oh sure! Sorry thought you were trying to get to sleep!
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