Spaces:
Build error
Build error
Pratham Bhat
commited on
Commit
·
3d61fab
1
Parent(s):
0252e20
Run app locally
Browse files- Dockerfile +6 -1
- main.py +0 -6
Dockerfile
CHANGED
@@ -1,5 +1,8 @@
|
|
1 |
FROM python:3.9
|
2 |
|
|
|
|
|
|
|
3 |
WORKDIR /code
|
4 |
RUN mkdir -p /code && chmod -R 777 /code
|
5 |
RUN mkdir -p /.cache && chmod -R 777 /.cache
|
@@ -13,4 +16,6 @@ COPY . .
|
|
13 |
|
14 |
RUN python3 -c "from transformers import AutoModelForCausalLM; AutoModelForCausalLM.from_pretrained('ibm-granite/granite-34b-code-instruct-8k', cache_dir='/.cache/huggingface')"
|
15 |
|
16 |
-
|
|
|
|
|
|
1 |
FROM python:3.9
|
2 |
|
3 |
+
ENV TQDM_DISABLE=0
|
4 |
+
ENV TQDM_FORCE=1
|
5 |
+
|
6 |
WORKDIR /code
|
7 |
RUN mkdir -p /code && chmod -R 777 /code
|
8 |
RUN mkdir -p /.cache && chmod -R 777 /.cache
|
|
|
16 |
|
17 |
RUN python3 -c "from transformers import AutoModelForCausalLM; AutoModelForCausalLM.from_pretrained('ibm-granite/granite-34b-code-instruct-8k', cache_dir='/.cache/huggingface')"
|
18 |
|
19 |
+
RUN uvicorn main:app --host 0.0.0.0 --port 7860
|
20 |
+
|
21 |
+
# CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
main.py
CHANGED
@@ -18,12 +18,6 @@ import torch
|
|
18 |
# torch.mps.empty_cache()
|
19 |
# torch.set_num_threads(1)
|
20 |
|
21 |
-
import os
|
22 |
-
# os.environ["HF_HOME"] = "/.cache"
|
23 |
-
# os.environ["TRANSFORMERS_CACHE"] = "/.cache"
|
24 |
-
os.environ["TQDM_DISABLE"] = "0"
|
25 |
-
os.environ["TQDM_FORCE"] = "1"
|
26 |
-
|
27 |
from transformers.utils import logging
|
28 |
logging.set_verbosity_info()
|
29 |
logger = logging.get_logger() # optional: get a logger instance if you want to customize
|
|
|
18 |
# torch.mps.empty_cache()
|
19 |
# torch.set_num_threads(1)
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
from transformers.utils import logging
|
22 |
logging.set_verbosity_info()
|
23 |
logger = logging.get_logger() # optional: get a logger instance if you want to customize
|