[go: up one dir, main page]

Skip to content

Commit

Permalink
fix: fix render deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
KenyonY committed Aug 10, 2023
1 parent 0997830 commit dcb16a7
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ container := "openai-forward-container"
compose_path := "docker-compose.yaml"

start:
docker run -d \
@docker run -d \
--name $(container) \
--env-file .env \
-p 8000:8000 \
-v $(shell pwd)/Log:/home/openai-forward/Log \
-v $(shell pwd)/openai_forward:/home/openai-forward/openai_forward \
$(image)

@make log

exec:
docker exec -it $(container) sh
Expand Down
2 changes: 1 addition & 1 deletion openai_forward/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.4.0"
__version__ = "0.4.1"

from dotenv import load_dotenv

Expand Down
2 changes: 1 addition & 1 deletion openai_forward/forwarding/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ async def reverse_proxy(self, request: Request):
uid = chat_info.get("uid")
except Exception as e:
logger.debug(
f"log chat error:\n{request.client.host=} {request.method=}: {traceback.format_exc()}"
f"log chat error:\nhost:{request.client.host} method:{request.method}: {traceback.format_exc()}"
)

req = self.client.build_request(
Expand Down
9 changes: 5 additions & 4 deletions openai_forward/forwarding/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
from ..helper import env2list, format_route_prefix

ENV_VAR_SEP = ","
OPENAI_BASE_URL = env2list("OPENAI_BASE_URL", sep=ENV_VAR_SEP)
OPENAI_BASE_URL = env2list("OPENAI_BASE_URL", sep=ENV_VAR_SEP) or [
"https://api.openai.com"
]

OPENAI_ROUTE_PREFIX = [
format_route_prefix(i) for i in env2list("OPENAI_ROUTE_PREFIX", sep=ENV_VAR_SEP)
]
if not OPENAI_ROUTE_PREFIX:
OPENAI_ROUTE_PREFIX = ['/']
] or ['/']

EXTRA_BASE_URL = env2list("EXTRA_BASE_URL", sep=ENV_VAR_SEP)
EXTRA_ROUTE_PREFIX = [
Expand Down
2 changes: 1 addition & 1 deletion openai_forward/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def convert_folder_to_jsonl(folder_path: str, target_path: str):
msg_len, ass_len = len(msg), len(ass)
if msg_len != ass_len:
print(
f"{log_path=} Length mismatch between message({msg_len}) and assistant({ass_len}) "
f"{log_path}: Length mismatch between message({msg_len}) and assistant({ass_len}) "
)
messages.extend(msg)
assistants.extend(ass)
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ classifiers = [
dependencies = [
"loguru>=0.7.0",
"fastapi>=0.90.0",
"uvicorn>=0.23.1",
"orjson>=3.9.2",
"uvicorn>=0.21.0",
"orjson>=3.9",
"python-dotenv",
"httpx>=0.24.1",
"httpx>=0.24",
"rich",
"fire",
"pytz",
Expand Down

0 comments on commit dcb16a7

Please sign in to comment.