Spaces:
Sleeping
Sleeping
Upload 2 files
Browse files- Dockerfile +5 -53
- main.py +1 -1
Dockerfile
CHANGED
@@ -1,60 +1,12 @@
|
|
1 |
-
# Use an official Python runtime as a parent image
|
2 |
FROM python:3.11-slim
|
3 |
|
4 |
-
|
5 |
-
WORKDIR /app
|
6 |
|
7 |
-
COPY ./requirements.txt /
|
|
|
|
|
8 |
|
9 |
-
RUN pip install --no-cache-dir -r /
|
10 |
|
11 |
-
COPY ./main.py /app/main.py
|
12 |
-
COPY ./Nous-Hermes-2-Mistral-7B-DPO.Q4_0.gguf /app/Nous-Hermes-2-Mistral-7B-DPO.Q4_0.gguf
|
13 |
-
|
14 |
-
# Make port 8000 available to the world outside this container
|
15 |
-
EXPOSE 8000
|
16 |
-
|
17 |
-
# Run main.py when the container launches # uvicorn main:app
|
18 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
19 |
|
20 |
-
# *** to build the docker image, at cmd line
|
21 |
-
# $> docker build -t myimage .
|
22 |
-
# if the above doesn't work, try the below
|
23 |
-
# trying, $> docker build --network=host -t iss_isa_convo_llm .
|
24 |
-
# don't forget the "."
|
25 |
-
|
26 |
-
# 'myimage' will be stored in docker, rename it to something else
|
27 |
-
# you can see it in $>docker images
|
28 |
-
|
29 |
-
# *** to run the docker image as a container
|
30 |
-
# $>docker run -d -p 10000:8000 iss_isa_convo_llm:latest
|
31 |
-
|
32 |
-
# ****** to push to Docker Hub
|
33 |
-
# Pushing images
|
34 |
-
# ==============
|
35 |
-
# You can push a new image to this repository using the CLI:
|
36 |
-
|
37 |
-
# $> docker tag local-image:tagname new-repo:tagname
|
38 |
-
# $> docker push new-repo:tagname
|
39 |
-
|
40 |
-
# Make sure to replace tagname with your desired image repository tag.
|
41 |
-
# my repo for this is rchai/convo_summariser (created on Docker Hub website)
|
42 |
-
|
43 |
-
# -----------------
|
44 |
-
# *** To upload aka push to docker hub
|
45 |
-
|
46 |
-
# step 1: tag the image (iss_isa_convo:latest) with the dockerhub repo name (created online) - rchai/convo_summariser:latest
|
47 |
-
# $> docker tag iss_isa_convo_llm:latest rchai/convo_summariser:latest
|
48 |
-
|
49 |
-
# step 2: log in
|
50 |
-
# $> docker login -u rchai -p your_password
|
51 |
-
|
52 |
-
# step 3: push to docker hub
|
53 |
-
# docker push the repo name (not the image name, it is the repo name
|
54 |
-
# which is why in step 1, we tag the image with the repo name, so that when we push the repo
|
55 |
-
# the correct image will be uploaded.
|
56 |
-
# tagname is same as version number.
|
57 |
-
# taganme of value "latest" means get the latest
|
58 |
-
# $> docker push rchai/convo_summariser:latest
|
59 |
-
|
60 |
-
|
|
|
|
|
1 |
FROM python:3.11-slim
|
2 |
|
3 |
+
WORKDIR /code
|
|
|
4 |
|
5 |
+
COPY ./requirements.txt /code/requirements.txt
|
6 |
+
COPY ./main.py /code/main.py
|
7 |
+
COPY ./Nous-Hermes-2-Mistral-7B-DPO.Q4_0.gguf /code/Nous-Hermes-2-Mistral-7B-DPO.Q4_0.gguf
|
8 |
|
9 |
+
RUN pip install --no-cache-dir -r /code/requirements.txt
|
10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
main.py
CHANGED
@@ -92,7 +92,7 @@ model_path_file = cwd / model_name
|
|
92 |
cbot = GPT4ALLChatBot(model=model_name,
|
93 |
user_prompt_template=USER_PROMPT_TEMPLATE,
|
94 |
system_prompt_template=SYSTEM_PROMPT_TEMPLATE,
|
95 |
-
allow_download=
|
96 |
|
97 |
# test code
|
98 |
# print(cbot.chat("hello!"))
|
|
|
92 |
cbot = GPT4ALLChatBot(model=model_name,
|
93 |
user_prompt_template=USER_PROMPT_TEMPLATE,
|
94 |
system_prompt_template=SYSTEM_PROMPT_TEMPLATE,
|
95 |
+
allow_download=False)
|
96 |
|
97 |
# test code
|
98 |
# print(cbot.chat("hello!"))
|