Spaces:
Runtime error
Runtime error
Commit
·
a67c09f
1
Parent(s):
90f7ec7
Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ import random
|
|
5 |
|
6 |
co = cohere.Client(os.environ['CO_API_KEY'])
|
7 |
# initialize a conversation session id
|
8 |
-
cohere_chat_res_start = co.chat("Hi")
|
9 |
conv_session_id = cohere_chat_res_start.session_id
|
10 |
|
11 |
whisper = gr.Interface.load(name="spaces/sanchit-gandhi/whisper-large-v2")
|
@@ -15,7 +15,7 @@ def translate_or_transcribe(audio, task):
|
|
15 |
return whisper(audio, None, task, fn_index=0)
|
16 |
|
17 |
def get_response_from_chatbot(text):
|
18 |
-
cohere_chat_res = co.chat(text, session_id=conv_session_id)
|
19 |
return cohere_chat_res.reply
|
20 |
|
21 |
def chat(message, chat_history):
|
|
|
5 |
|
6 |
co = cohere.Client(os.environ['CO_API_KEY'])
|
7 |
# initialize a conversation session id
|
8 |
+
cohere_chat_res_start = co.chat("Hi", persona = "catgpt")
|
9 |
conv_session_id = cohere_chat_res_start.session_id
|
10 |
|
11 |
whisper = gr.Interface.load(name="spaces/sanchit-gandhi/whisper-large-v2")
|
|
|
15 |
return whisper(audio, None, task, fn_index=0)
|
16 |
|
17 |
def get_response_from_chatbot(text):
|
18 |
+
cohere_chat_res = co.chat(text, session_id=conv_session_id, persona = "catgpt")
|
19 |
return cohere_chat_res.reply
|
20 |
|
21 |
def chat(message, chat_history):
|