Spaces:
Running
on
A10G
Running
on
A10G
tricktreat
commited on
Commit
•
16c92c7
1
Parent(s):
e72271e
fix(log): Create log dir if not existed (#31)
Browse files- fix: Fix issue about log dir (47037f4814b18c92f616e294371572e0aed8de3b)
- awesome_chat.py +3 -3
awesome_chat.py
CHANGED
@@ -36,8 +36,8 @@ if __name__ != "__main__":
|
|
36 |
|
37 |
config = yaml.load(open(args.config, "r"), Loader=yaml.FullLoader)
|
38 |
|
39 |
-
|
40 |
-
|
41 |
|
42 |
now = datetime.datetime.now().strftime("%Y-%m-%d-%H-%M-%S")
|
43 |
|
@@ -930,4 +930,4 @@ def chat_huggingface(messages, openaikey = None, huggingfacetoken = None, return
|
|
930 |
answer = {"message": response}
|
931 |
record_case(success=True, **{"input": input, "task": task_str, "results": results, "response": response, "during": during, "op":"response"})
|
932 |
logger.info(f"response: {response}")
|
933 |
-
return response, results
|
|
|
36 |
|
37 |
config = yaml.load(open(args.config, "r"), Loader=yaml.FullLoader)
|
38 |
|
39 |
+
if not os.path.exists("logs"):
|
40 |
+
os.mkdir("logs")
|
41 |
|
42 |
now = datetime.datetime.now().strftime("%Y-%m-%d-%H-%M-%S")
|
43 |
|
|
|
930 |
answer = {"message": response}
|
931 |
record_case(success=True, **{"input": input, "task": task_str, "results": results, "response": response, "during": during, "op":"response"})
|
932 |
logger.info(f"response: {response}")
|
933 |
+
return response, results
|