Spaces:
Sleeping
Sleeping
Try to download the model at build time
Browse files- Dockerfile +3 -0
- setup.py +7 -0
Dockerfile
CHANGED
@@ -17,5 +17,8 @@ ENV HOME=/home/user \
|
|
17 |
WORKDIR $HOME/app
|
18 |
|
19 |
COPY --chown=user ./main.py $HOME/app/main.py
|
|
|
|
|
|
|
20 |
|
21 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
17 |
WORKDIR $HOME/app
|
18 |
|
19 |
COPY --chown=user ./main.py $HOME/app/main.py
|
20 |
+
COPY --chown=user ./setup.py $HOME/app/setup.py
|
21 |
+
|
22 |
+
RUN su -s /bin/bash -c "$HOME/app/setup.py" -g user user
|
23 |
|
24 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
setup.py
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from ctransformers import AutoModelForCausalLM
|
2 |
+
|
3 |
+
model = AutoModelForCausalLM.from_pretrained("TheBloke/Vigostral-7B-Chat-GGUF",
|
4 |
+
model_file="vigostral-7b-chat.Q4_K_M.gguf",
|
5 |
+
model_type="mistral",
|
6 |
+
threads = 3
|
7 |
+
)
|