umsee commited on
Commit
75708e7
1 Parent(s): da1505f

activating debug mode

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -8,16 +8,16 @@ llm = ChatCohere(model='command-r')
8
  pipe = pipeline("automatic-speech-recognition", model="openai/whisper-base")
9
  parser = StrOutputParser()
10
 
11
- def getting_prompt(txtmsg,spkmsg):
12
- # print(spkmsg)
13
  recog_text = pipe(spkmsg)
14
  messages = [
15
- SystemMessage(content=txtmsg),
16
  HumanMessage(content=recog_text['text']),
17
  ]
18
  chain = llm | parser
19
  response = chain.invoke(messages)
20
  return response
21
 
22
- demo = gr.Interface(getting_prompt,['text',gr.Audio(sources="microphone",type='filepath')],'text')
23
  demo.launch(debug=True)
 
8
  pipe = pipeline("automatic-speech-recognition", model="openai/whisper-base")
9
  parser = StrOutputParser()
10
 
11
+ def getting_prompt(doclist,spkmsg):
12
+ print(spkmsg)
13
  recog_text = pipe(spkmsg)
14
  messages = [
15
+ SystemMessage(content='You are A helpful AI assistant and will provide truthful information from the context and your knowledge if you are prompted.'),
16
  HumanMessage(content=recog_text['text']),
17
  ]
18
  chain = llm | parser
19
  response = chain.invoke(messages)
20
  return response
21
 
22
+ demo = gr.Interface(getting_prompt,['file',gr.Audio(sources="microphone",type='filepath')],'text')
23
  demo.launch(debug=True)