Spaces:
Runtime error
Runtime error
test
commited on
Commit
·
793072f
1
Parent(s):
23759b0
add verbose mode
Browse files
app.py
CHANGED
@@ -10,6 +10,7 @@ from store import store_message_pair
|
|
10 |
|
11 |
# Environment Variables
|
12 |
DEBUG = bool(os.getenv("DEBUG", False))
|
|
|
13 |
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
|
14 |
BING_TRANSLATE_API_KEY = os.getenv("BING_TRANSLATE_API_KEY")
|
15 |
|
@@ -101,7 +102,7 @@ def bot(history_bo: list, history_en: list, request: gr.Request):
|
|
101 |
resopnse_bo = bing_translate(response_en, LANG_ZH, LANG_BO)
|
102 |
history_en.append({"role": ROLE_ASSISTANT, "content": response_en})
|
103 |
history_bo[-1][1] = resopnse_bo
|
104 |
-
if
|
105 |
print("------------------------")
|
106 |
print(history_bo)
|
107 |
print(history_en)
|
|
|
10 |
|
11 |
# Environment Variables
|
12 |
DEBUG = bool(os.getenv("DEBUG", False))
|
13 |
+
VERBOSE = bool(os.getenv("V", False))
|
14 |
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
|
15 |
BING_TRANSLATE_API_KEY = os.getenv("BING_TRANSLATE_API_KEY")
|
16 |
|
|
|
102 |
resopnse_bo = bing_translate(response_en, LANG_ZH, LANG_BO)
|
103 |
history_en.append({"role": ROLE_ASSISTANT, "content": response_en})
|
104 |
history_bo[-1][1] = resopnse_bo
|
105 |
+
if VERBOSE:
|
106 |
print("------------------------")
|
107 |
print(history_bo)
|
108 |
print(history_en)
|