Update app.py
Browse files
app.py
CHANGED
|
@@ -11,9 +11,9 @@ from pydub import AudioSegment
|
|
| 11 |
from openai import OpenAI
|
| 12 |
|
| 13 |
########## For creating a debug report
|
| 14 |
-
import subprocess
|
| 15 |
-
myGradioEnvironment = subprocess.run(['gradio','environment'], stdout=subprocess.PIPE)
|
| 16 |
-
print(myGradioEnvironment.stdout.decode('utf-8'))
|
| 17 |
|
| 18 |
# Load API key from an environment variable
|
| 19 |
OPENAI_SECRET_KEY = os.environ.get("OPENAI_SECRET_KEY")
|
|
@@ -118,7 +118,8 @@ def transcribe(audio, history_type):
|
|
| 118 |
|
| 119 |
|
| 120 |
#Ask OpenAI to create note transcript
|
| 121 |
-
response = client.chat.completions.create(model="gpt-
|
|
|
|
| 122 |
#response = client.chat.completions.create(model="gpt-3.5-turbo", temperature=0, messages=messages)
|
| 123 |
|
| 124 |
note_transcript = response.choices[0].message.content
|
|
@@ -136,8 +137,8 @@ my_inputs = [
|
|
| 136 |
|
| 137 |
ui = gr.Interface(fn=transcribe,
|
| 138 |
inputs=my_inputs,
|
| 139 |
-
outputs=[#RichTextbox(label="Your Note (gpt-
|
| 140 |
-
gr.Textbox(label="Your Note (gpt-
|
| 141 |
gr.Number(label=".mp3 MB")],
|
| 142 |
title="Jenkins",
|
| 143 |
)
|
|
|
|
| 11 |
from openai import OpenAI
|
| 12 |
|
| 13 |
########## For creating a debug report
|
| 14 |
+
# import subprocess
|
| 15 |
+
# myGradioEnvironment = subprocess.run(['gradio','environment'], stdout=subprocess.PIPE)
|
| 16 |
+
# print(myGradioEnvironment.stdout.decode('utf-8'))
|
| 17 |
|
| 18 |
# Load API key from an environment variable
|
| 19 |
OPENAI_SECRET_KEY = os.environ.get("OPENAI_SECRET_KEY")
|
|
|
|
| 118 |
|
| 119 |
|
| 120 |
#Ask OpenAI to create note transcript
|
| 121 |
+
response = client.chat.completions.create(model="gpt-4o", temperature=0, messages=messages)
|
| 122 |
+
#response = client.chat.completions.create(model="gpt-4-turbo-2024-04-09", temperature=0, messages=messages)
|
| 123 |
#response = client.chat.completions.create(model="gpt-3.5-turbo", temperature=0, messages=messages)
|
| 124 |
|
| 125 |
note_transcript = response.choices[0].message.content
|
|
|
|
| 137 |
|
| 138 |
ui = gr.Interface(fn=transcribe,
|
| 139 |
inputs=my_inputs,
|
| 140 |
+
outputs=[#RichTextbox(label="Your Note (gpt-4o)"),
|
| 141 |
+
gr.Textbox(label="Your Note (gpt-4o)", show_copy_button=True),
|
| 142 |
gr.Number(label=".mp3 MB")],
|
| 143 |
title="Jenkins",
|
| 144 |
)
|