Skip to content

Commit 883c281

Browse files
committed
updating
1 parent 1257d35 commit 883c281

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

dockerfiles/llm_predictor/src/model.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,8 @@ def predict(self, request: dict, headers: dict) -> dict:
4646
instruction = data["instruction"]
4747
context = data["context"]
4848
query = data["input"]
49-
5049
logger.info(f"Received instruction: {instruction}")
5150
logger.info(f"Received input: {query}")
52-
5351
# generation parameters
5452
temperature = data.get("temperature", .2)
5553
max_tokens = data.get("max_tokens", 200)
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
FROM python:3.10.6-slim
2+
23
COPY src/requirements.txt /src/requirements.txt
4+
35
RUN DEBIAN_FRONTEND=noninteractive
6+
47
RUN apt update && apt install build-essential -y
8+
59
RUN pip install --upgrade pip && pip install -r /src/requirements.txt
10+
611
COPY src/model.py /src/model.py
12+
713
WORKDIR /src
14+
815
RUN chmod -R 777 /src
9-
ENTRYPOINT ["python", "model.py"]
1016

17+
ENTRYPOINT ["python", "model.py"]

dockerfiles/llm_transformer/src/model.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ def _build_vectorstore_url(self):
3939
deployment_name = self.vectorstore_name
4040
model_name = deployment_name
4141
# Build the vectorstore URL
42-
svc = f'{deployment_name}-predictor-default.{namespace}.{domain_name}'
43-
url = f"https://{svc}/v1/models/{model_name}:predict"
42+
svc = f'{deployment_name}-predictor.{namespace}.{domain_name}'
43+
url = f"http://{svc}/v1/models/{model_name}:predict"
4444
return url
4545

4646
@property
@@ -51,16 +51,11 @@ def _http_client(self):
5151
return self._http_client_instance
5252

5353
def preprocess(self, request: dict, headers: dict) -> dict:
54-
self.authorization = headers["authorization"]
55-
5654
data = request["instances"][0]
5755
query = data["input"]
58-
5956
logger.info(f"Received question: {query}")
60-
6157
num_docs = data.get("num_docs", 4)
6258
context = data.get("context", None)
63-
6459
if context:
6560
logger.info(f"Received context: {context}")
6661
logger.info(f"Skipping retrieval step...")
@@ -71,7 +66,7 @@ def preprocess(self, request: dict, headers: dict) -> dict:
7166
f"Receiving relevant docs from: {self.vectorstore_url}")
7267

7368
response = requests.post(
74-
self.vectorstore_url, json=payload, headers=headers,
69+
self.vectorstore_url, json=payload,
7570
verify=False)
7671
response = json.loads(response.text)
7772
context = "\n".join(response["predictions"])

0 commit comments

Comments
 (0)