mskov commited on
Commit
20b392a
·
1 Parent(s): cdf8b61

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -46,8 +46,8 @@ openai.api_key = os.environ["Openai_APIkey"]
46
  # Transcribe function
47
  def transcribe(audio_file):
48
  print("Transcribing")
49
- # transcription = asr_model.transcribe(audio_file)["text"]
50
- transcription = asr_model.transcribe(audio_file)
51
  return transcription
52
 
53
  def inference(audio, latest):
@@ -57,12 +57,12 @@ def inference(audio, latest):
57
 
58
  if transcript != None:
59
  latest.append(transcript)
60
- text = EXAMPLE_PROMPT + str(transcript) + "\nPrediction: "
61
- else: text = EXAMPLE_PROMPT
62
 
63
  response = openai.Completion.create(
64
  model="text-davinci-003",
65
- prompt=text,
66
  temperature=0.8,
67
  max_tokens=18,
68
  n=5)
 
46
  # Transcribe function
47
  def transcribe(audio_file):
48
  print("Transcribing")
49
+ transcription = asr_model.transcribe(audio_file)["text"]
50
+ #transcription = asr_model.transcribe(audio_file)
51
  return transcription
52
 
53
  def inference(audio, latest):
 
57
 
58
  if transcript != None:
59
  latest.append(transcript)
60
+ tscript = EXAMPLE_PROMPT + str(transcript) + "\nPrediction: "
61
+ else: tscript = EXAMPLE_PROMPT
62
 
63
  response = openai.Completion.create(
64
  model="text-davinci-003",
65
+ prompt=tscript,
66
  temperature=0.8,
67
  max_tokens=18,
68
  n=5)