Spaces:
Running
Running
rafaldembski
commited on
Commit
•
2cf0420
1
Parent(s):
29027c1
Update app.py
Browse files
app.py
CHANGED
@@ -92,8 +92,7 @@ def change_language(language, user_message, submit_button, clear_button):
|
|
92 |
gr.update(placeholder=selected_translation["input_placeholder"]),
|
93 |
gr.update(value=selected_translation["submit_button"]),
|
94 |
gr.update(value=selected_translation["clear_button"]),
|
95 |
-
selected_translation["description"]
|
96 |
-
examples[language]
|
97 |
)
|
98 |
|
99 |
# Tłumaczenia interfejsu
|
@@ -110,7 +109,7 @@ translations = {
|
|
110 |
<br/><br/>
|
111 |
**Model**: [C4AI Command R+](https://huggingface.co/CohereForAI/c4ai-command-r-plus)
|
112 |
<br/>
|
113 |
-
**Stworzony przez**: [Cohere](https://cohere.com/)
|
114 |
<br/>
|
115 |
**Licencja**: [CC-BY-NC](https://cohere.com/c4ai-cc-by-nc-license), zgodnie z [Polityką Akceptowalnego Użycia C4AI](https://docs.cohere.com/docs/c4ai-acceptable-use-policy)
|
116 |
<br/><br/>
|
@@ -129,7 +128,7 @@ translations = {
|
|
129 |
<br/><br/>
|
130 |
**Modell**: [C4AI Command R+](https://huggingface.co/CohereForAI/c4ai-command-r-plus)
|
131 |
<br/>
|
132 |
-
**Entwickelt von**: [Cohere](https://cohere.com/)
|
133 |
<br/>
|
134 |
**Lizenz**: [CC-BY-NC](https://cohere.com/c4ai-cc-by-nc-license), in Übereinstimmung mit [C4AI's Richtlinie zur akzeptablen Nutzung](https://docs.cohere.com/docs/c4ai-acceptable-use-policy)
|
135 |
<br/><br/>
|
@@ -148,7 +147,7 @@ translations = {
|
|
148 |
<br/><br/>
|
149 |
**Model**: [C4AI Command R+](https://huggingface.co/CohereForAI/c4ai-command-r-plus)
|
150 |
<br/>
|
151 |
-
**Developed by**: [Cohere](https://cohere.com/)
|
152 |
<br/>
|
153 |
**License**: [CC-BY-NC](https://cohere.com/c4ai-cc-by-nc-license), in accordance with [C4AI's Acceptable Use Policy](https://docs.cohere.com/docs/c4ai-acceptable-use-policy)
|
154 |
<br/><br/>
|
@@ -157,24 +156,18 @@ translations = {
|
|
157 |
}
|
158 |
}
|
159 |
|
160 |
-
#
|
161 |
-
examples =
|
162 |
-
"
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
"
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
"en": [
|
173 |
-
"Outline a comprehensive marketing strategy for launching a new tech product.",
|
174 |
-
"What are the latest trends in artificial intelligence in 2024?",
|
175 |
-
"Describe the recruitment process in a tech company, step by step."
|
176 |
-
]
|
177 |
-
}
|
178 |
|
179 |
with gr.Blocks(analytics_enabled=False, theme=gr.themes.Monochrome()) as demo:
|
180 |
language = gr.State("en")
|
@@ -212,15 +205,15 @@ with gr.Blocks(analytics_enabled=False, theme=gr.themes.Monochrome()) as demo:
|
|
212 |
|
213 |
with gr.Row():
|
214 |
examples_component = gr.Examples(
|
215 |
-
examples=examples
|
216 |
inputs=[user_message],
|
217 |
cache_examples=False,
|
218 |
fn=generate_response,
|
219 |
outputs=[chatbot],
|
220 |
-
examples_per_page=
|
221 |
)
|
222 |
|
223 |
-
language_selector.change(fn=change_language, inputs=[language_selector, user_message, submit_button, clear_button], outputs=[user_message, submit_button, clear_button, description
|
224 |
|
225 |
if __name__ == "__main__":
|
226 |
demo.queue(api_open=False, max_size=40).launch(show_api=False)
|
|
|
92 |
gr.update(placeholder=selected_translation["input_placeholder"]),
|
93 |
gr.update(value=selected_translation["submit_button"]),
|
94 |
gr.update(value=selected_translation["clear_button"]),
|
95 |
+
selected_translation["description"]
|
|
|
96 |
)
|
97 |
|
98 |
# Tłumaczenia interfejsu
|
|
|
109 |
<br/><br/>
|
110 |
**Model**: [C4AI Command R+](https://huggingface.co/CohereForAI/c4ai-command-r-plus)
|
111 |
<br/>
|
112 |
+
**Stworzony przez**: [Cohere](https://cohere.com/), [Cohere for AI](https://cohere.com/research) oraz Rafała Dembskiego jako twórcę chatbota D-LOGIC.
|
113 |
<br/>
|
114 |
**Licencja**: [CC-BY-NC](https://cohere.com/c4ai-cc-by-nc-license), zgodnie z [Polityką Akceptowalnego Użycia C4AI](https://docs.cohere.com/docs/c4ai-acceptable-use-policy)
|
115 |
<br/><br/>
|
|
|
128 |
<br/><br/>
|
129 |
**Modell**: [C4AI Command R+](https://huggingface.co/CohereForAI/c4ai-command-r-plus)
|
130 |
<br/>
|
131 |
+
**Entwickelt von**: [Cohere](https://cohere.com/), [Cohere for AI](https://cohere.com/research) und Rafał Dembski als Entwickler des D-LOGIC Chatbots.
|
132 |
<br/>
|
133 |
**Lizenz**: [CC-BY-NC](https://cohere.com/c4ai-cc-by-nc-license), in Übereinstimmung mit [C4AI's Richtlinie zur akzeptablen Nutzung](https://docs.cohere.com/docs/c4ai-acceptable-use-policy)
|
134 |
<br/><br/>
|
|
|
147 |
<br/><br/>
|
148 |
**Model**: [C4AI Command R+](https://huggingface.co/CohereForAI/c4ai-command-r-plus)
|
149 |
<br/>
|
150 |
+
**Developed by**: [Cohere](https://cohere.com/), [Cohere for AI](https://cohere.com/research), and Rafał Dembski as the creator of the D-LOGIC chatbot.
|
151 |
<br/>
|
152 |
**License**: [CC-BY-NC](https://cohere.com/c4ai-cc-by-nc-license), in accordance with [C4AI's Acceptable Use Policy](https://docs.cohere.com/docs/c4ai-acceptable-use-policy)
|
153 |
<br/><br/>
|
|
|
156 |
}
|
157 |
}
|
158 |
|
159 |
+
# Dodane profesjonalne przykłady
|
160 |
+
examples = [
|
161 |
+
"Napisz szczegółowy plan marketingowy dla nowego produktu technologicznego.",
|
162 |
+
"Jakie są najnowsze trendy w sztucznej inteligencji w 2024 roku?",
|
163 |
+
"Opisz proces rekrutacji w firmie IT, krok po kroku.",
|
164 |
+
"Erstellen Sie eine SWOT-Analyse für die Einführung eines neuen Produkts auf dem deutschen Markt.",
|
165 |
+
"Welche ethischen Herausforderungen bestehen bei der Implementierung von KI im Gesundheitswesen?",
|
166 |
+
"Schildern Sie die Schritte für eine erfolgreiche digitale Transformation in einem mittelständischen Unternehmen.",
|
167 |
+
"Outline a comprehensive marketing strategy for launching a new tech product.",
|
168 |
+
"What are the latest trends in artificial intelligence in 2024?",
|
169 |
+
"Describe the recruitment process in a tech company, step by step."
|
170 |
+
]
|
|
|
|
|
|
|
|
|
|
|
|
|
171 |
|
172 |
with gr.Blocks(analytics_enabled=False, theme=gr.themes.Monochrome()) as demo:
|
173 |
language = gr.State("en")
|
|
|
205 |
|
206 |
with gr.Row():
|
207 |
examples_component = gr.Examples(
|
208 |
+
examples=examples,
|
209 |
inputs=[user_message],
|
210 |
cache_examples=False,
|
211 |
fn=generate_response,
|
212 |
outputs=[chatbot],
|
213 |
+
examples_per_page=9
|
214 |
)
|
215 |
|
216 |
+
language_selector.change(fn=change_language, inputs=[language_selector, user_message, submit_button, clear_button], outputs=[user_message, submit_button, clear_button, description])
|
217 |
|
218 |
if __name__ == "__main__":
|
219 |
demo.queue(api_open=False, max_size=40).launch(show_api=False)
|