Handle truncation errors (#436)

This commit is contained in:
Lianmin Zheng
2024-05-13 15:56:00 -07:00
committed by GitHub
parent 4231a42fa8
commit 5dc55a5f02
10 changed files with 44 additions and 41 deletions

View File

@@ -29,7 +29,7 @@ class TestBind(unittest.TestCase):
tracer = few_shot_qa_2.trace()
print(tracer.last_node.print_graph_dfs() + "\n")
def test_pin(self):
def test_cache(self):
@sgl.function
def few_shot_qa(s, prompt, question):
s += prompt
@@ -41,8 +41,7 @@ class TestBind(unittest.TestCase):
few_shot_qa_2 = few_shot_qa.bind(
prompt="Answer the following questions as if you were a 5-year-old kid.\n\n"
)
few_shot_qa_2.pin(self.backend)
few_shot_qa_2.unpin(self.backend)
few_shot_qa_2.cache(self.backend)
if __name__ == "__main__":
@@ -50,4 +49,4 @@ if __name__ == "__main__":
# t = TestBind()
# t.setUp()
# t.test_pin()
# t.test_cache()