(self)
| 98 | assert len(res) >= 1024 |
| 99 | |
| 100 | def test_rag(self): |
| 101 | from examples.rag import ppl |
| 102 | rag = lazyllm.ActionModule(ppl) |
| 103 | rag.start() |
| 104 | query = '何为天道?' |
| 105 | res = rag(query) |
| 106 | assert type(res) is str |
| 107 | assert '天道' in res |
| 108 | assert len(res) >= 16 |
| 109 | |
| 110 | # test rag warpped in web |
| 111 | _, client = self.warp_into_web(rag) |
| 112 | chat_history = [[query, None]] |
| 113 | ans = client.predict(self.use_context, |
| 114 | chat_history, |
| 115 | self.stream_output, |
| 116 | self.append_text, |
| 117 | api_name='/_respond_stream') |
| 118 | res = ans[0][-1][-1] |
| 119 | assert type(res) is str |
| 120 | assert '天道' in res |
| 121 | assert len(res) >= 16 |
| 122 | |
| 123 | def test_painting(self): |
| 124 | from examples.painting import ppl |
nothing calls this directly
no test coverage detected