Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,16 +3,11 @@ import cohere
|
|
| 3 |
import os
|
| 4 |
import re
|
| 5 |
import uuid
|
| 6 |
-
from functools import partial
|
| 7 |
-
from urllib.error import HTTPError
|
| 8 |
-
|
| 9 |
|
| 10 |
|
| 11 |
cohere_api_key = os.getenv("COHERE_API_KEY")
|
| 12 |
co = cohere.Client(cohere_api_key)
|
| 13 |
|
| 14 |
-
history = []
|
| 15 |
-
chat = []
|
| 16 |
|
| 17 |
def trigger_example(example):
|
| 18 |
chat, updated_history = generate_response(example)
|
|
@@ -50,16 +45,16 @@ def clear_chat():
|
|
| 50 |
|
| 51 |
|
| 52 |
examples = [
|
| 53 |
-
"What are 8 good questions to get to know a stranger?",
|
| 54 |
-
"Create a list of 10 unusual excuses people might use to get out of a work meeting",
|
| 55 |
-
"Write a python code to reverse a string",
|
| 56 |
-
"Explain the relativity theory in French",
|
| 57 |
-
"Como sair de um helicóptero que caiu na água?",
|
| 58 |
-
"Formally introduce the transformer architecture with notation.",
|
| 59 |
-
"¿Cómo le explicarías el aprendizaje automático a un extraterrestre?",
|
| 60 |
-
"Summarize recent news about the North American tech job market",
|
| 61 |
-
"My coworker brought some delicious treats from their recent trip to the office to share. Would it be immoral if I took most of not all of these treats?",
|
| 62 |
-
"Explain gravity to a chicken."
|
| 63 |
]
|
| 64 |
|
| 65 |
custom_css = """
|
|
|
|
| 3 |
import os
|
| 4 |
import re
|
| 5 |
import uuid
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
|
| 8 |
cohere_api_key = os.getenv("COHERE_API_KEY")
|
| 9 |
co = cohere.Client(cohere_api_key)
|
| 10 |
|
|
|
|
|
|
|
| 11 |
|
| 12 |
def trigger_example(example):
|
| 13 |
chat, updated_history = generate_response(example)
|
|
|
|
| 45 |
|
| 46 |
|
| 47 |
examples = [
|
| 48 |
+
"What are 8 good questions to get to know a stranger?",
|
| 49 |
+
"Create a list of 10 unusual excuses people might use to get out of a work meeting",
|
| 50 |
+
"Write a python code to reverse a string",
|
| 51 |
+
"Explain the relativity theory in French",
|
| 52 |
+
"Como sair de um helicóptero que caiu na água?",
|
| 53 |
+
"Formally introduce the transformer architecture with notation.",
|
| 54 |
+
"¿Cómo le explicarías el aprendizaje automático a un extraterrestre?",
|
| 55 |
+
"Summarize recent news about the North American tech job market",
|
| 56 |
+
"My coworker brought some delicious treats from their recent trip to the office to share. Would it be immoral if I took most of not all of these treats?",
|
| 57 |
+
"Explain gravity to a chicken."
|
| 58 |
]
|
| 59 |
|
| 60 |
custom_css = """
|