muryshev commited on
Commit
a5ee5e1
·
1 Parent(s): 67beed8
Files changed (3) hide show
  1. fastapi_app.py +5 -4
  2. llm/deepinfra_api.py +1 -1
  3. llm/vllm_api.py +2 -3
fastapi_app.py CHANGED
@@ -9,15 +9,16 @@ import traceback
9
  from llm.common import LlmParams, LlmPredictParams
10
  from llm.deepinfra_api import DeepInfraApi
11
 
 
 
 
12
  # Set the path for log files
13
  LOGS_BASE_PATH = os.getenv("LOGS_BASE_PATH", "logs")
14
 
15
  # Create logs directory if it doesn't exist
16
- # if not os.path.exists(LOGS_BASE_PATH):
17
- # os.makedirs(LOGS_BASE_PATH)
18
 
19
- # Check if logs are enabled
20
- ENABLE_LOGS = os.getenv("ENABLE_LOGS", "0") == "1"
21
  LLM_API_URL = os.getenv("LLM_API_URL", "")
22
  LLM_API_KEY = os.getenv("LLM_API_KEY", "")
23
  LLM_USE_DEEPINFRA = os.getenv("LLM_USE_DEEPINFRA", "") == "1"
 
9
  from llm.common import LlmParams, LlmPredictParams
10
  from llm.deepinfra_api import DeepInfraApi
11
 
12
+ # Check if logs are enabled
13
+ ENABLE_LOGS = os.getenv("ENABLE_LOGS", "0") == "1"
14
+
15
  # Set the path for log files
16
  LOGS_BASE_PATH = os.getenv("LOGS_BASE_PATH", "logs")
17
 
18
  # Create logs directory if it doesn't exist
19
+ if ENABLE_LOGS and not os.path.exists(LOGS_BASE_PATH):
20
+ os.makedirs(LOGS_BASE_PATH)
21
 
 
 
22
  LLM_API_URL = os.getenv("LLM_API_URL", "")
23
  LLM_API_KEY = os.getenv("LLM_API_KEY", "")
24
  LLM_USE_DEEPINFRA = os.getenv("LLM_USE_DEEPINFRA", "") == "1"
llm/deepinfra_api.py CHANGED
@@ -1,7 +1,7 @@
1
  import json
2
  from typing import Optional, List
3
  import httpx
4
- from common import LlmPredictParams, LlmParams, LlmApi
5
 
6
  class DeepInfraApi(LlmApi):
7
  """
 
1
  import json
2
  from typing import Optional, List
3
  import httpx
4
+ from llm.common import LlmParams, LlmApi
5
 
6
  class DeepInfraApi(LlmApi):
7
  """
llm/vllm_api.py CHANGED
@@ -1,9 +1,8 @@
1
  import json
2
- from typing import Optional, List, Any
3
 
4
  import httpx
5
- from pydantic import BaseModel, Field
6
- from common import LlmPredictParams, LlmParams, LlmApi
7
 
8
 
9
  class LlmApi(LlmApi):
 
1
  import json
2
+ from typing import Optional, List
3
 
4
  import httpx
5
+ from llm.common import LlmParams, LlmApi
 
6
 
7
 
8
  class LlmApi(LlmApi):