nickmuchi commited on
Commit
c0abd8f
·
verified ·
1 Parent(s): 62dd9f0

Update functions.py

Browse files
Files changed (1) hide show
  1. functions.py +3 -3
functions.py CHANGED
@@ -9,7 +9,7 @@ import json
9
  import streamlit as st
10
  import requests
11
 
12
- openai_audio = OpenAI()
13
 
14
  # def load_whisper_api(audio):
15
 
@@ -26,7 +26,7 @@ def load_whisper_api(audio):
26
 
27
  '''Transcribe YT audio to text using Open AI API'''
28
  file = open(audio, "rb")
29
- transcript = openai_audio.audio.transcriptions.create(model="whisper-1", file=file,response_format="text")
30
 
31
  return transcript
32
 
@@ -113,7 +113,7 @@ def get_podcast_summary(podcast_transcript):
113
 
114
  request = instructPrompt + podcast_transcript
115
 
116
- chatOutput = openai.ChatCompletion.create(model="gpt-3.5-turbo-16k",
117
  messages=[{"role": "system", "content": "You are a helpful assistant."},
118
  {"role": "user", "content": request}
119
  ]
 
9
  import streamlit as st
10
  import requests
11
 
12
+ client = OpenAI()
13
 
14
  # def load_whisper_api(audio):
15
 
 
26
 
27
  '''Transcribe YT audio to text using Open AI API'''
28
  file = open(audio, "rb")
29
+ transcript = client.audio.transcriptions.create(model="whisper-1", file=file,response_format="text")
30
 
31
  return transcript
32
 
 
113
 
114
  request = instructPrompt + podcast_transcript
115
 
116
+ chatOutput = client.completions.create(model="gpt-3.5-turbo-16k",
117
  messages=[{"role": "system", "content": "You are a helpful assistant."},
118
  {"role": "user", "content": request}
119
  ]