umsee commited on
Commit ·
75708e7
1
Parent(s): da1505f
activating debug mode
Browse files
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(
|
| 12 |
-
|
| 13 |
recog_text = pipe(spkmsg)
|
| 14 |
messages = [
|
| 15 |
-
SystemMessage(content=
|
| 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,['
|
| 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)
|