ka1kuk commited on
Commit
c840cdf
1 Parent(s): e5fe9d2

Update apis/chat_api.py

Browse files
Files changed (1) hide show
  1. apis/chat_api.py +3 -8
apis/chat_api.py CHANGED
@@ -1,7 +1,6 @@
1
  import argparse
2
  import os
3
  import sys
4
- from datetime import datetime
5
  import time
6
  import uvicorn
7
 
@@ -17,12 +16,8 @@ from mocks.stream_chat_mocker import stream_chat_mock
17
 
18
 
19
  class ChatAPIApp:
20
- # Get the current datetime
21
- now = datetime.now()
22
-
23
- # Convert the current datetime to a timestamp
24
- timestamp = int(time.mktime(now.timetuple()))
25
  def __init__(self):
 
26
  self.app = FastAPI(
27
  docs_url="/",
28
  title="HuggingFace LLM API",
@@ -41,14 +36,14 @@ class ChatAPIApp:
41
  "id": "mixtral-8x7b",
42
  "description": "[mistralai/Mixtral-8x7B-Instruct-v0.1]: https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1",
43
  "object": "model",
44
- "created": str(timestamp),
45
  "owned_by": "mistralai",
46
  },
47
  {
48
  "id": "mistral-7b",
49
  "description": "[mistralai/Mistral-7B-Instruct-v0.2]: https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2",
50
  "object": "model",
51
- "created": str(timestamp),
52
  "owned_by": "mistralai",
53
  },
54
  ],
 
1
  import argparse
2
  import os
3
  import sys
 
4
  import time
5
  import uvicorn
6
 
 
16
 
17
 
18
  class ChatAPIApp:
 
 
 
 
 
19
  def __init__(self):
20
+ current_time = int(time.time())
21
  self.app = FastAPI(
22
  docs_url="/",
23
  title="HuggingFace LLM API",
 
36
  "id": "mixtral-8x7b",
37
  "description": "[mistralai/Mixtral-8x7B-Instruct-v0.1]: https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1",
38
  "object": "model",
39
+ "created": str(current_time),
40
  "owned_by": "mistralai",
41
  },
42
  {
43
  "id": "mistral-7b",
44
  "description": "[mistralai/Mistral-7B-Instruct-v0.2]: https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2",
45
  "object": "model",
46
+ "created": str(current_time),
47
  "owned_by": "mistralai",
48
  },
49
  ],