MCPcopy Create free account
hub / github.com/OpenBitSys/BitDistiller / is_partial_stop

Function is_partial_stop

inference/stream_generators/falcon_stream_gen.py:13–18  ·  view source on GitHub ↗

Check whether the output contains a partial stop str.

(output: str, stop_str: str)

Source from the content-addressed store, hash-verified

11
12
13def is_partial_stop(output: str, stop_str: str):
14 """Check whether the output contains a partial stop str."""
15 for i in range(0, min(len(output), len(stop_str))):
16 if stop_str.startswith(output[-i:]):
17 return True
18 return False
19
20
21@torch.inference_mode()

Callers 1

FalconStreamGeneratorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected