Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bootstrap/ic-rhoai-configuration/images-puller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ spec:
cpu: 10m
memory: 10Mi
- name: ds-pipeline-runtime-image-confidence
image: quay.io/rh-aiservices-bu/rhoai-lab-insurance-claim-confidence-pipeline:1.1
image: quay.io/rh-aiservices-bu/rhoai-lab-insurance-claim-confidence-pipeline:1.2
command: ["tail"]
args: ["-f", "/dev/null"]
resources:
Expand Down
2 changes: 1 addition & 1 deletion lab-materials/03/06/confidence-check.pipeline
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@
"mounted_volumes": [],
"kubernetes_secrets": [],
"env_vars": [],
"runtime_image": "quay.io/rh-aiservices-bu/rhoai-lab-insurance-claim-confidence-pipeline:1.1"
"runtime_image": "quay.io/rh-aiservices-bu/rhoai-lab-insurance-claim-confidence-pipeline:1.2"
}
}
},
Expand Down
8 changes: 4 additions & 4 deletions lab-materials/03/06/confidence-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.annotations['pipelines.kubeflow.org/run_name']
image: quay.io/rh-aiservices-bu/rhoai-lab-insurance-claim-confidence-pipeline:1.1
image: quay.io/rh-aiservices-bu/rhoai-lab-insurance-claim-confidence-pipeline:1.2
stepTemplate:
volumeMounts:
- name: mlpipeline-metrics
Expand Down Expand Up @@ -127,7 +127,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.annotations['pipelines.kubeflow.org/run_name']
image: quay.io/rh-aiservices-bu/rhoai-lab-insurance-claim-confidence-pipeline:1.1
image: quay.io/rh-aiservices-bu/rhoai-lab-insurance-claim-confidence-pipeline:1.2
stepTemplate:
volumeMounts:
- name: mlpipeline-metrics
Expand Down Expand Up @@ -183,7 +183,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.annotations['pipelines.kubeflow.org/run_name']
image: quay.io/rh-aiservices-bu/rhoai-lab-insurance-claim-confidence-pipeline:1.1
image: quay.io/rh-aiservices-bu/rhoai-lab-insurance-claim-confidence-pipeline:1.2
stepTemplate:
volumeMounts:
- name: mlpipeline-metrics
Expand Down Expand Up @@ -239,7 +239,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.annotations['pipelines.kubeflow.org/run_name']
image: quay.io/rh-aiservices-bu/rhoai-lab-insurance-claim-confidence-pipeline:1.1
image: quay.io/rh-aiservices-bu/rhoai-lab-insurance-claim-confidence-pipeline:1.2
stepTemplate:
volumeMounts:
- name: mlpipeline-metrics
Expand Down
4 changes: 2 additions & 2 deletions lab-materials/03/06/llm_usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
TEMPERATURE = 0.01
PRESENCE_PENALTY = 1.03

def infer_with_template(input_text, template):
def infer_with_template(input_text, template, max_tokens = MAX_NEW_TOKENS):
llm = VLLMOpenAI(
openai_api_key="EMPTY",
openai_api_base= f"{INFERENCE_SERVER_URL}/v1",
model_name="granite-7b-instruct",
max_tokens=MAX_NEW_TOKENS,
max_tokens=max_tokens,
top_p=TOP_P,
temperature=TEMPERATURE,
presence_penalty=PRESENCE_PENALTY,
Expand Down
21 changes: 20 additions & 1 deletion lab-materials/03/06/test_response_quality.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,26 @@ def test_response_quality():
with open('summary_template.txt') as f:
template = f.read()

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."""
expected_response = """Dear John Smith,
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.
To initiate a claim, please follow these steps:
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.
2. Log in to your policyholder account on our website or contact our customer service department at (800) 123-4567 to report the claim.
3. Our representative will guide you through the claim process, asking for the required information and providing you with a claim number.
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.
5. Once the assessment is complete, your adjuster will provide you with a detailed repair estimate and discuss the next steps for claim settlement.
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.
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.
Sincerely,
XYZ Insurance Company
Claims Department"""

response = infer_with_template(input_text, template)
print(f"Response: {response}")
Expand Down
4 changes: 2 additions & 2 deletions lab-materials/03/06/test_responsetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ def send_request(endpoint):

def test_responsetime():
TEMPLATE = """<|system|>
Answer below truthfully and in less than 10 words:
Answer below in less than 10 words:
<|user|>
### QUESTION:
{silly_question}
### ANSWER:
<|assistant|>"""

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

if response_time>max_response_time:
Expand Down
Loading