feat: init
This commit is contained in:
parent
0f291c762e
commit
919605f39c
@ -1,2 +1,3 @@
|
|||||||
.env
|
.env
|
||||||
env
|
model
|
||||||
|
__pycache__
|
||||||
|
@ -1 +1 @@
|
|||||||
python 3.10.13
|
python 3.11.5
|
||||||
|
25
Dockerfile
25
Dockerfile
@ -1,23 +1,10 @@
|
|||||||
FROM python:3.10-bookworm AS base
|
FROM git.orionkindel.com/tpl/asdf:bookworm
|
||||||
|
|
||||||
FROM base AS tini
|
COPY .tool-versions ./
|
||||||
|
RUN asdf install
|
||||||
|
|
||||||
ENV TINI_VERSION v0.19.0
|
COPY requirements.txt ./
|
||||||
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
|
|
||||||
RUN chmod +x /tini
|
|
||||||
ENTRYPOINT ["/tini", "--"]
|
|
||||||
|
|
||||||
FROM tini AS tools
|
|
||||||
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
|
|
||||||
--mount=type=cache,target=/var/lib/apt,sharing=locked \
|
|
||||||
export DEBIAN_FRONTEND=noninteractive \
|
|
||||||
&& apt-get update -y \
|
|
||||||
&& apt-get upgrade -y
|
|
||||||
|
|
||||||
COPY requirements.txt requirements.txt
|
|
||||||
RUN pip install -r requirements.txt
|
RUN pip install -r requirements.txt
|
||||||
|
|
||||||
FROM tools AS api
|
COPY ./ ./
|
||||||
|
CMD ["python", "./"]
|
||||||
COPY . .
|
|
||||||
CMD ["python", "."]
|
|
||||||
|
@ -16,6 +16,7 @@ model = T5ForConditionalGeneration.from_pretrained(
|
|||||||
|
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
api_keys = getenv('API_KEYS').split(sep=",")
|
api_keys = getenv('API_KEYS').split(sep=",")
|
||||||
|
port = getenv('PORT') or 9010
|
||||||
|
|
||||||
generator = pipeline("text2text-generation", model=model, tokenizer=tokenizer)
|
generator = pipeline("text2text-generation", model=model, tokenizer=tokenizer)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user