Skip to content

Commit

Permalink
Fix docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
hibobmaster committed Sep 17, 2023
1 parent dab64d5 commit 7fe0cce
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 97 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM python:3.11-alpine as base

FROM base as pybuilder
# RUN sed -i 's|v3\.\d*|edge|' /etc/apk/repositories
RUN apk update && apk add --no-cache olm-dev gcc musl-dev libmagic libffi-dev
RUN apk update && apk add --no-cache olm-dev gcc musl-dev libmagic libffi-dev cmake make g++ git python3-dev
COPY requirements.txt /requirements.txt
RUN pip install -U pip setuptools wheel && pip install --user -r /requirements.txt && rm /requirements.txt

Expand Down
4 changes: 3 additions & 1 deletion src/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ def __init__(

self.base_path = Path(os.path.dirname(__file__)).parent

if lc_admin is not None:
lc_admin = list(filter(None, lc_admin.split(",")))
self.lc_admin = lc_admin
self.lc_cache = {}
if self.lc_admin is not None:
Expand Down Expand Up @@ -1372,7 +1374,7 @@ async def help(self, room_id, reply_to_event_id, sender_id, user_message):
help_info = (
"!gpt [prompt], generate a one time response without context conversation\n"
+ "!chat [prompt], chat with context conversation\n"
+ "!pic [prompt], Image generation by Microsoft Bing\n"
+ "!pic [prompt], Image generation by DALL·E or LocalAI or stable-diffusion-webui\n" # noqa: E501
+ "!new + chat, start a new conversation \n"
+ "!lc [prompt], chat using langchain api\n"
+ "!help, help message"
Expand Down
81 changes: 0 additions & 81 deletions src/chatgpt_bing.py

This file was deleted.

28 changes: 14 additions & 14 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ async def main():
openai_api_key=config.get("openai_api_key"),
gpt_api_endpoint=config.get("gpt_api_endpoint"),
gpt_model=config.get("gpt_model"),
max_tokens=int(config.get("max_tokens")),
top_p=float(config.get("top_p")),
presence_penalty=float(config.get("presence_penalty")),
frequency_penalty=float(config.get("frequency_penalty")),
reply_count=int(config.get("reply_count")),
max_tokens=config.get("max_tokens"),
top_p=config.get("top_p"),
presence_penalty=config.get("presence_penalty"),
frequency_penalty=config.get("frequency_penalty"),
reply_count=config.get("reply_count"),
system_prompt=config.get("system_prompt"),
temperature=float(config.get("temperature")),
temperature=config.get("temperature"),
lc_admin=config.get("lc_admin"),
image_generation_endpoint=config.get("image_generation_endpoint"),
image_generation_backend=config.get("image_generation_backend"),
timeout=float(config.get("timeout")),
timeout=config.get("timeout"),
)
if (
config.get("import_keys_path")
Expand All @@ -63,17 +63,17 @@ async def main():
openai_api_key=os.environ.get("OPENAI_API_KEY"),
gpt_api_endpoint=os.environ.get("GPT_API_ENDPOINT"),
gpt_model=os.environ.get("GPT_MODEL"),
max_tokens=int(os.environ.get("MAX_TOKENS")),
top_p=float(os.environ.get("TOP_P")),
presence_penalty=float(os.environ.get("PRESENCE_PENALTY")),
frequency_penalty=float(os.environ.get("FREQUENCY_PENALTY")),
max_tokens=os.environ.get("MAX_TOKENS"),
top_p=os.environ.get("TOP_P"),
presence_penalty=os.environ.get("PRESENCE_PENALTY"),
frequency_penalty=os.environ.get("FREQUENCY_PENALTY"),
reply_count=int(os.environ.get("REPLY_COUNT")),
system_prompt=os.environ.get("SYSTEM_PROMPT"),
temperature=float(os.environ.get("TEMPERATURE")),
lc_admin=list(filter(None, os.environ.get("LC_ADMIN").split(","))),
temperature=os.environ.get("TEMPERATURE"),
lc_admin=os.environ.get("LC_ADMIN"),
image_generation_endpoint=os.environ.get("IMAGE_GENERATION_ENDPOINT"),
image_generation_backend=os.environ.get("IMAGE_GENERATION_BACKEND"),
timeout=float(os.environ.get("TIMEOUT")),
timeout=os.environ.get("TIMEOUT"),
)
if (
os.environ.get("IMPORT_KEYS_PATH")
Expand Down

0 comments on commit 7fe0cce

Please sign in to comment.