(path)
| 20 | truncated_text = tokenizer.decode(tokens) |
| 21 | return truncated_text |
| 22 | def create_if_not_exist(path): |
| 23 | if not os.path.exists(path): # 如果目录不存在,递归创建该目录 |
| 24 | os.makedirs(path, exist_ok=True) |
| 25 | |
| 26 | def dicts_almost_equal(dict1, dict2, tolerance=1e-6): |
| 27 | # 比较字典时允许浮动误差 |
no outgoing calls
no test coverage detected