awacke1 commited on
Commit
fc50946
·
1 Parent(s): 5daa1d1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -37,6 +37,7 @@ def chat_with_model(prompt, document_section):
37
  response = openai.ChatCompletion.create(model=model, messages=conversation)
38
  return response['choices'][0]['message']['content']
39
 
 
40
  def transcribe_audio(openai_key, file_path, model):
41
  OPENAI_API_URL = "https://api.openai.com/v1/audio/transcriptions"
42
  headers = {
@@ -49,9 +50,7 @@ def transcribe_audio(openai_key, file_path, model):
49
  st.write('Reasoning with your transcription..')
50
  st.write(response.json())
51
  response2 = chat_with_model(response.json().get('text'), '') # send transcript to ChatGPT
52
- st.write('Reasoning with your transcription..')
53
- #st.write(response)
54
- st.write(response2)
55
  return response2
56
  else:
57
  st.write(response.json())
 
37
  response = openai.ChatCompletion.create(model=model, messages=conversation)
38
  return response['choices'][0]['message']['content']
39
 
40
+ # Updated to auto process transcript to chatgpt in AI pipeline from Whisper to ChatGPT
41
  def transcribe_audio(openai_key, file_path, model):
42
  OPENAI_API_URL = "https://api.openai.com/v1/audio/transcriptions"
43
  headers = {
 
50
  st.write('Reasoning with your transcription..')
51
  st.write(response.json())
52
  response2 = chat_with_model(response.json().get('text'), '') # send transcript to ChatGPT
53
+ create_file(filename, response, response2)
 
 
54
  return response2
55
  else:
56
  st.write(response.json())