Spaces:
Sleeping
Sleeping
Update functions.py
Browse files- functions.py +3 -3
functions.py
CHANGED
@@ -9,7 +9,7 @@ import json
|
|
9 |
import streamlit as st
|
10 |
import requests
|
11 |
|
12 |
-
|
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 =
|
30 |
|
31 |
return transcript
|
32 |
|
@@ -113,7 +113,7 @@ def get_podcast_summary(podcast_transcript):
|
|
113 |
|
114 |
request = instructPrompt + podcast_transcript
|
115 |
|
116 |
-
chatOutput =
|
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 |
]
|