Skip to content

Commit a2d91c5

Browse files
authored
Fix image version and working with new templates (#172)
1 parent d355509 commit a2d91c5

File tree

6 files changed

+30
-11
lines changed

6 files changed

+30
-11
lines changed

bootstrap/ic-rhoai-configuration/images-puller.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ spec:
155155
cpu: 10m
156156
memory: 10Mi
157157
- name: ds-pipeline-runtime-image-confidence
158-
image: quay.io/rh-aiservices-bu/rhoai-lab-insurance-claim-confidence-pipeline:1.1
158+
image: quay.io/rh-aiservices-bu/rhoai-lab-insurance-claim-confidence-pipeline:1.2
159159
command: ["tail"]
160160
args: ["-f", "/dev/null"]
161161
resources:

lab-materials/03/06/confidence-check.pipeline

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@
281281
"mounted_volumes": [],
282282
"kubernetes_secrets": [],
283283
"env_vars": [],
284-
"runtime_image": "quay.io/rh-aiservices-bu/rhoai-lab-insurance-claim-confidence-pipeline:1.1"
284+
"runtime_image": "quay.io/rh-aiservices-bu/rhoai-lab-insurance-claim-confidence-pipeline:1.2"
285285
}
286286
}
287287
},

lab-materials/03/06/confidence-check.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ spec:
7171
valueFrom:
7272
fieldRef:
7373
fieldPath: metadata.annotations['pipelines.kubeflow.org/run_name']
74-
image: quay.io/rh-aiservices-bu/rhoai-lab-insurance-claim-confidence-pipeline:1.1
74+
image: quay.io/rh-aiservices-bu/rhoai-lab-insurance-claim-confidence-pipeline:1.2
7575
stepTemplate:
7676
volumeMounts:
7777
- name: mlpipeline-metrics
@@ -127,7 +127,7 @@ spec:
127127
valueFrom:
128128
fieldRef:
129129
fieldPath: metadata.annotations['pipelines.kubeflow.org/run_name']
130-
image: quay.io/rh-aiservices-bu/rhoai-lab-insurance-claim-confidence-pipeline:1.1
130+
image: quay.io/rh-aiservices-bu/rhoai-lab-insurance-claim-confidence-pipeline:1.2
131131
stepTemplate:
132132
volumeMounts:
133133
- name: mlpipeline-metrics
@@ -183,7 +183,7 @@ spec:
183183
valueFrom:
184184
fieldRef:
185185
fieldPath: metadata.annotations['pipelines.kubeflow.org/run_name']
186-
image: quay.io/rh-aiservices-bu/rhoai-lab-insurance-claim-confidence-pipeline:1.1
186+
image: quay.io/rh-aiservices-bu/rhoai-lab-insurance-claim-confidence-pipeline:1.2
187187
stepTemplate:
188188
volumeMounts:
189189
- name: mlpipeline-metrics
@@ -239,7 +239,7 @@ spec:
239239
valueFrom:
240240
fieldRef:
241241
fieldPath: metadata.annotations['pipelines.kubeflow.org/run_name']
242-
image: quay.io/rh-aiservices-bu/rhoai-lab-insurance-claim-confidence-pipeline:1.1
242+
image: quay.io/rh-aiservices-bu/rhoai-lab-insurance-claim-confidence-pipeline:1.2
243243
stepTemplate:
244244
volumeMounts:
245245
- name: mlpipeline-metrics

lab-materials/03/06/llm_usage.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
TEMPERATURE = 0.01
1010
PRESENCE_PENALTY = 1.03
1111

12-
def infer_with_template(input_text, template):
12+
def infer_with_template(input_text, template, max_tokens = MAX_NEW_TOKENS):
1313
llm = VLLMOpenAI(
1414
openai_api_key="EMPTY",
1515
openai_api_base= f"{INFERENCE_SERVER_URL}/v1",
1616
model_name="granite-7b-instruct",
17-
max_tokens=MAX_NEW_TOKENS,
17+
max_tokens=max_tokens,
1818
top_p=TOP_P,
1919
temperature=TEMPERATURE,
2020
presence_penalty=PRESENCE_PENALTY,

lab-materials/03/06/test_response_quality.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,26 @@ def test_response_quality():
99
with open('summary_template.txt') as f:
1010
template = f.read()
1111

12-
expected_response = """On October 15, 2023, at around 2:30 PM, John Smith was involved in a car accident at the intersection of Elm Street and Maple Avenue in Springfield, Illinois (coordinates: 39.7476° N, 89.6960° W). He was driving his Honda Accord with a green light when a Ford Escape, which ran a red light, collided with the front passenger side of his vehicle. The accident occurred in overcast weather with light rain, and the road was wet. No serious injuries were reported, but both vehicles sustained significant damage. A police report was filed, and the officer's badge number is 12345. Witnesses to the accident include Sarah Johnson, Mark Williams, and Lisa Anderson, and their contact information has been provided. Photos of the accident scene, including the damage to both vehicles, traffic signals, and road conditions, have also been taken. John is requesting that a claim be initiated under his policy (ABC12345) for the damages to his vehicle and is asking for guidance on the claim process and required documentation."""
12+
expected_response = """Dear John Smith,
13+
14+
Thank you for contacting XYZ Insurance Company regarding your recent car accident. We are sorry to hear about the incident and are committed to assisting you through this process.
15+
16+
To initiate a claim, please follow these steps:
17+
18+
1. Gather all necessary documentation, including the accident report (with the officer's badge number), witness contact information, photos of the accident scene, and your vehicle's repair estimate.
19+
2. Log in to your policyholder account on our website or contact our customer service department at (800) 123-4567 to report the claim.
20+
3. Our representative will guide you through the claim process, asking for the required information and providing you with a claim number.
21+
4. Your insurance adjuster will be assigned to your case and will contact you to schedule an appointment to inspect the damage to your vehicle.
22+
5. Once the assessment is complete, your adjuster will provide you with a detailed repair estimate and discuss the next steps for claim settlement.
23+
24+
Please note that the time it takes to process a claim can vary depending on the complexity of the accident and the amount of damage involved. We appreciate your patience and cooperation throughout this process.
25+
26+
If you have any questions or need further assistance, please do not hesitate to contact us at (800) 123-4567 or email us at [email protected]. We are here to help.
27+
28+
Sincerely,
29+
30+
XYZ Insurance Company
31+
Claims Department"""
1332

1433
response = infer_with_template(input_text, template)
1534
print(f"Response: {response}")

lab-materials/03/06/test_responsetime.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ def send_request(endpoint):
1111

1212
def test_responsetime():
1313
TEMPLATE = """<|system|>
14-
Answer below truthfully and in less than 10 words:
14+
Answer below in less than 10 words:
1515
<|user|>
1616
### QUESTION:
1717
{silly_question}
1818
### ANSWER:
1919
<|assistant|>"""
2020

2121
start = time.perf_counter()
22-
response = infer_with_template("Who saw a saw saw a salsa?", TEMPLATE)
22+
response = infer_with_template("Who saw a saw saw a salsa?", TEMPLATE, max_tokens=20)
2323
response_time = time.perf_counter() - start
2424

2525
if response_time>max_response_time:

0 commit comments

Comments
 (0)