diff --git a/bootstrap/ic-rhoai-configuration/images-puller.yaml b/bootstrap/ic-rhoai-configuration/images-puller.yaml index 77139ec5..6d8ee5a5 100644 --- a/bootstrap/ic-rhoai-configuration/images-puller.yaml +++ b/bootstrap/ic-rhoai-configuration/images-puller.yaml @@ -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: diff --git a/lab-materials/03/06/confidence-check.pipeline b/lab-materials/03/06/confidence-check.pipeline index 17135701..711977ed 100644 --- a/lab-materials/03/06/confidence-check.pipeline +++ b/lab-materials/03/06/confidence-check.pipeline @@ -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" } } }, diff --git a/lab-materials/03/06/confidence-check.yaml b/lab-materials/03/06/confidence-check.yaml index 70b16363..f18035f2 100644 --- a/lab-materials/03/06/confidence-check.yaml +++ b/lab-materials/03/06/confidence-check.yaml @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/lab-materials/03/06/llm_usage.py b/lab-materials/03/06/llm_usage.py index 459952b8..4cb15e60 100644 --- a/lab-materials/03/06/llm_usage.py +++ b/lab-materials/03/06/llm_usage.py @@ -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, diff --git a/lab-materials/03/06/test_response_quality.py b/lab-materials/03/06/test_response_quality.py index 28a115b9..6a5d2ada 100644 --- a/lab-materials/03/06/test_response_quality.py +++ b/lab-materials/03/06/test_response_quality.py @@ -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 claims@xyzinsurance.com. We are here to help. + +Sincerely, + +XYZ Insurance Company +Claims Department""" response = infer_with_template(input_text, template) print(f"Response: {response}") diff --git a/lab-materials/03/06/test_responsetime.py b/lab-materials/03/06/test_responsetime.py index a4798245..98e5756a 100644 --- a/lab-materials/03/06/test_responsetime.py +++ b/lab-materials/03/06/test_responsetime.py @@ -11,7 +11,7 @@ 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} @@ -19,7 +19,7 @@ def test_responsetime(): <|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: