Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -18,7 +18,7 @@ def trigger_example(example):
|
|
| 18 |
def generate_response(user_message, cid, token, history=None):
|
| 19 |
|
| 20 |
if not token:
|
| 21 |
-
raise gr.Error("
|
| 22 |
|
| 23 |
if history is None:
|
| 24 |
history = []
|
|
@@ -56,19 +56,7 @@ def clear_chat():
|
|
| 56 |
examples = [
|
| 57 |
"What are 8 good questions to get to know a stranger?",
|
| 58 |
"Create a list of 10 unusual excuses people might use to get out of a work meeting",
|
| 59 |
-
"
|
| 60 |
-
"Explain the relativity theory in French",
|
| 61 |
-
"Como sair de um helicóptero que caiu na água?",
|
| 62 |
-
"Formally introduce the transformer architecture with notation.",
|
| 63 |
-
"¿Cómo le explicarías el aprendizaje automático a un extraterrestre?",
|
| 64 |
-
"Summarize recent news about the North American tech job market",
|
| 65 |
-
"Explain gravity to a chicken.",
|
| 66 |
-
"Is the world discrete or analog?",
|
| 67 |
-
"What is the memory cost in a typical implementation of an all-gather operation?",
|
| 68 |
-
"Give me a brief history of the golden era of Cantopop.",
|
| 69 |
-
"Descrivi il processo di creazione di un capolavoro, come se fossi un artista del Rinascimento a Firenze.",
|
| 70 |
-
"Explique-moi le sens de la vie selon un grand auteur littéraire.",
|
| 71 |
-
"Give me an example of an endangered species and let me know what I can do to help preserve it"
|
| 72 |
]
|
| 73 |
|
| 74 |
custom_css = """
|
|
@@ -87,7 +75,7 @@ with gr.Blocks(analytics_enabled=False, css=custom_css) as demo:
|
|
| 87 |
|
| 88 |
with gr.Row():
|
| 89 |
with gr.Column(scale=1):
|
| 90 |
-
gr.Image("
|
| 91 |
with gr.Column(scale=3):
|
| 92 |
gr.Markdown("""C4AI Command R+ is a research open weights release of a 104B billion parameter with highly advanced Retrieval Augmented Generation (RAG) capabilities, tool Use to automate sophisticated tasks, and is multilingual in 10 languages: English, French, Spanish, Italian, German, Portuguese, Japanese, Korean, Arabic, and Chinese. Command R+ is optimized for a variety of use cases including reasoning, summarization, and question answering.
|
| 93 |
<br/><br/>
|
|
@@ -109,7 +97,7 @@ with gr.Blocks(analytics_enabled=False, css=custom_css) as demo:
|
|
| 109 |
|
| 110 |
with gr.Row():
|
| 111 |
submit_button = gr.Button("Submit")
|
| 112 |
-
clear_button = gr.Button("
|
| 113 |
|
| 114 |
|
| 115 |
history = gr.State([])
|
|
|
|
| 18 |
def generate_response(user_message, cid, token, history=None):
|
| 19 |
|
| 20 |
if not token:
|
| 21 |
+
raise gr.Error("Vui lòng truy cập website của Cohere để lấy API Key")
|
| 22 |
|
| 23 |
if history is None:
|
| 24 |
history = []
|
|
|
|
| 56 |
examples = [
|
| 57 |
"What are 8 good questions to get to know a stranger?",
|
| 58 |
"Create a list of 10 unusual excuses people might use to get out of a work meeting",
|
| 59 |
+
"Vân vân và mây mây..."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
]
|
| 61 |
|
| 62 |
custom_css = """
|
|
|
|
| 75 |
|
| 76 |
with gr.Row():
|
| 77 |
with gr.Column(scale=1):
|
| 78 |
+
gr.Image("https://i.ibb.co/w66DyJz/KTH.jpg", elem_id="logo-img", show_label=False, show_share_button=False, show_download_button=False)
|
| 79 |
with gr.Column(scale=3):
|
| 80 |
gr.Markdown("""C4AI Command R+ is a research open weights release of a 104B billion parameter with highly advanced Retrieval Augmented Generation (RAG) capabilities, tool Use to automate sophisticated tasks, and is multilingual in 10 languages: English, French, Spanish, Italian, German, Portuguese, Japanese, Korean, Arabic, and Chinese. Command R+ is optimized for a variety of use cases including reasoning, summarization, and question answering.
|
| 81 |
<br/><br/>
|
|
|
|
| 97 |
|
| 98 |
with gr.Row():
|
| 99 |
submit_button = gr.Button("Submit")
|
| 100 |
+
clear_button = gr.Button("Xoá đoạn chat")
|
| 101 |
|
| 102 |
|
| 103 |
history = gr.State([])
|