From d8c8c3e6820a2f9e017596bfd30a6f92e403d4fe Mon Sep 17 00:00:00 2001 From: Richard Gong Date: Thu, 15 Feb 2024 19:41:55 +0000 Subject: [PATCH] Update print --- ci/check_inference.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ci/check_inference.py b/ci/check_inference.py index b76058d..67a64d0 100644 --- a/ci/check_inference.py +++ b/ci/check_inference.py @@ -10,8 +10,13 @@ CREATE TABLE head (age INTEGER) How many heads of the departments are older than 56 ? [/INST] """ - output = subprocess.check_output(["modal", "run", "src.inference", "--run-folder", f"/runs/{run_name}", "--prompt", prompt]) + p = subprocess.Popen(["modal", "run", "src.inference", "--run-folder", f"/runs/{run_name}", "--prompt", prompt], stdout=subprocess.PIPE) + output = "" - print("Asserting that output contains [SQ] SELECT ... [/SQL]") + for line in iter(p.stdout.readline, b''): + output += line.decode() + + print(output) + print("Asserting that the output contains the expected SQL query") assert b"[SQL] SELECT" in output and b"[/SQL]" in output