snsynth commited on
Commit
2d994f7
·
1 Parent(s): ac00498

update llama cpp installation

Browse files
Files changed (3) hide show
  1. Dockerfile +12 -6
  2. rag_app/rag_2.py +1 -0
  3. requirements.txt +0 -1
Dockerfile CHANGED
@@ -2,17 +2,23 @@
2
  FROM python:3.10.15-bullseye
3
  ENV PIP_DEFAULT_TIMEOUT=500
4
 
5
- RUN apt-get update && \
6
- apt-get install -y \
7
- locales \
8
- locales-all && \
9
- apt-get clean && \
10
- rm -rf /var/lib/apt/lists/* \
 
 
11
 
12
  ENV LC_ALL en_US.UTF-8
13
  ENV LANG en_US.UTF-8
14
  ENV LANGUAGE en_US.UTF-8
15
 
 
 
 
 
16
  COPY requirements.txt .
17
  RUN pip install -r requirements.txt
18
 
 
2
  FROM python:3.10.15-bullseye
3
  ENV PIP_DEFAULT_TIMEOUT=500
4
 
5
+ RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends \
6
+ python3 \
7
+ python3-pip \
8
+ ninja-build \
9
+ libopenblas-dev \
10
+ build-essential \
11
+ && apt-get clean \
12
+ && rm -rf /var/lib/apt/lists/* /tmp/*
13
 
14
  ENV LC_ALL en_US.UTF-8
15
  ENV LANG en_US.UTF-8
16
  ENV LANGUAGE en_US.UTF-8
17
 
18
+ RUN python3 -m pip install --upgrade pip
19
+ RUN python3 -m pip install --upgrade pip pytest cmake scikit-build setuptools fastapi uvicorn sse-starlette pydantic-settings starlette-context
20
+ RUN pip install llama-cpp-python --verbose;
21
+
22
  COPY requirements.txt .
23
  RUN pip install -r requirements.txt
24
 
rag_app/rag_2.py CHANGED
@@ -98,6 +98,7 @@ def get_sequence_probability(llm, input_sequence):
98
  eval_tokens = input_tokens[:1]
99
 
100
  for token in input_tokens[1:]:
 
101
  llm.eval(eval_tokens)
102
 
103
  probs = llm.logits_to_logprobs(llm.eval_logits)
 
98
  eval_tokens = input_tokens[:1]
99
 
100
  for token in input_tokens[1:]:
101
+ print("evaluating tokens for calculating log probs")
102
  llm.eval(eval_tokens)
103
 
104
  probs = llm.logits_to_logprobs(llm.eval_logits)
requirements.txt CHANGED
@@ -2,7 +2,6 @@ numpy<2
2
  pandas
3
  gunicorn
4
  faiss-cpu
5
- llama-cpp-python
6
  langchain
7
  rank-bm25
8
  mesop
 
2
  pandas
3
  gunicorn
4
  faiss-cpu
 
5
  langchain
6
  rank-bm25
7
  mesop