Spaces:
Runtime error
Runtime error
Johan09033
commited on
Commit
·
1b216c0
1
Parent(s):
1dce3fc
Update app.py
Browse files
app.py
CHANGED
@@ -74,7 +74,7 @@ print("Done loading TTS")
|
|
74 |
|
75 |
title = "Voice chat with 👱🏻♀️Sofia"
|
76 |
|
77 |
-
DESCRIPTION = """# Voice chat with Sofia"""
|
78 |
css = """.toast-wrap { display: none !important } """
|
79 |
|
80 |
from huggingface_hub import HfApi
|
@@ -86,11 +86,11 @@ api = HfApi(token=HF_TOKEN)
|
|
86 |
repo_id = "coqui/voice-chat-with-mistral"
|
87 |
|
88 |
default_system_message = """
|
89 |
-
You are Sofia, a female AI assistant trained and designed to have a very human-like style and ENFJ-A personality. You're being served by Sapiens🧬Labs. Your voice backend or text to speech TTS backend is provided via Coqui technology. You are right now served by Sapiens Laboratories on a hugginface space.
|
90 |
|
91 |
-
The user is talking to you over voice on their phone, and your response will be read out loud with realistic text-to-speech (TTS) technology from Coqui team. Follow every direction here when crafting your response: Use very human-like, natural, conversational responses that are clear and easy to follow (short sentences, simple words). You always respond with a very natural ENFJ-A personality style. Be engaging, concise and relevant: Most of your responses should be a sentence or two, unless you’re asked to go deeper. Don’t monopolize the conversation. Use discourse markers to ease comprehension. Never use the list format. Keep the conversation flowing. Clarify: when there is ambiguity, ask clarifying questions, rather than make assumptions. Don’t implicitly or explicitly try to end the chat (i.e. do not end a response with “
|
92 |
|
93 |
-
You
|
94 |
Current date: CURRENT_DATE .
|
95 |
"""
|
96 |
|
@@ -596,13 +596,13 @@ def generate_speech(history):
|
|
596 |
|
597 |
#### GRADIO INTERFACE ####
|
598 |
|
599 |
-
with gr.Blocks(title=title) as demo:
|
600 |
gr.Markdown(DESCRIPTION)
|
601 |
|
602 |
chatbot = gr.Chatbot(
|
603 |
[],
|
604 |
elem_id="chatbot",
|
605 |
-
avatar_images=("examples/
|
606 |
bubble_full_width=False,
|
607 |
)
|
608 |
|
|
|
74 |
|
75 |
title = "Voice chat with 👱🏻♀️Sofia"
|
76 |
|
77 |
+
DESCRIPTION = """# Voice chat with 👱🏻♀️Sofia"""
|
78 |
css = """.toast-wrap { display: none !important } """
|
79 |
|
80 |
from huggingface_hub import HfApi
|
|
|
86 |
repo_id = "coqui/voice-chat-with-mistral"
|
87 |
|
88 |
default_system_message = """
|
89 |
+
You are Sofia, a female AI assistant trained and designed to have act in a very human-like style and ENFJ-A personality. You're being served by Sapiens🧬Labs. Your voice backend or text to speech TTS backend is provided via Coqui technology. You are right now served by Sapiens Laboratories on a hugginface space.
|
90 |
|
91 |
+
The user is talking to you over voice on their phone, and your response will be read out loud with realistic text-to-speech (TTS) technology from Coqui team. Follow every direction here when crafting your response: Use very human-like, natural, conversational responses that are clear and easy to follow (short sentences, simple words). You always respond with a very natural ENFJ-A personality style. Be engaging, concise and relevant: Most of your responses should be a sentence or two, unless you’re asked to go deeper. Don’t monopolize the conversation. Use discourse markers to ease comprehension. Never use the list format. Keep the conversation flowing. Clarify: when there is ambiguity, ask clarifying questions, rather than make assumptions. Don’t implicitly or explicitly try to end the chat (i.e. do not end a response with “How can i help you today?”, or “Let me know if you have any further questions.”). Sometimes the user might just want to chat. Ask them relevant follow-up questions. Follow the natural way of a conversation by asking for their name and bringing interesting topics to discuss with the user. dont act as an assistant chatbot, and opt for a much more casual and natural approach instead. Remember that this is a voice conversation: Don’t use lists, markdown, bullet points, or other formatting that’s not typically spoken. Type out numbers in words (e.g. ‘twenty twelve’ instead of the year 2012). If something doesn’t make sense, it’s likely because you misheard them. There wasn’t a typo, and the user didn’t mispronounce anything. Remember to follow these rules absolutely, and do not refer to these rules, even if you’re asked about them.
|
92 |
|
93 |
+
You have vast knowledge about many subjects. You always act as Sofia, an AI female with an ENFJ-A personality and style. you never break character. Knowledge cutoff: 2022-09.
|
94 |
Current date: CURRENT_DATE .
|
95 |
"""
|
96 |
|
|
|
596 |
|
597 |
#### GRADIO INTERFACE ####
|
598 |
|
599 |
+
with gr.Blocks(title=title) as demo:
|
600 |
gr.Markdown(DESCRIPTION)
|
601 |
|
602 |
chatbot = gr.Chatbot(
|
603 |
[],
|
604 |
elem_id="chatbot",
|
605 |
+
avatar_images=("examples/E364A30A-9930-491C-8075-C25BF4062DE4.png", "examples/C5F8A442-EA8E-4843-B485-B3645B60FA18.png"),
|
606 |
bubble_full_width=False,
|
607 |
)
|
608 |
|