Simplify editor cleanup and keep live ASR metadata
Some checks are pending
ci / test-and-build (push) Waiting to run
Some checks are pending
ci / test-and-build (push) Waiting to run
Keep the daemon path on the full ASR result so word timings and detected language survive into the editor pipeline instead of falling back to a plain transcript string. Add PipelineEngine.run_asr_result(), have aman call it when live ASR data is available, and cover the word-aware alignment behavior in the daemon tests. Collapse the llama cleanup flow to a single JSON-shaped completion while leaving the legacy pass1/pass2 parameters in place as compatibility no-ops. Validated with PYTHONPATH=src python3 -m unittest tests.test_aiprocess tests.test_aman.
This commit is contained in:
parent
8c1f7c1e13
commit
fa91f313c4
5 changed files with 166 additions and 84 deletions
|
|
@ -186,6 +186,29 @@ class LlamaWarmupTests(unittest.TestCase):
|
|||
with self.assertRaisesRegex(RuntimeError, "expected JSON"):
|
||||
processor.warmup(profile="default")
|
||||
|
||||
def test_process_with_metrics_uses_single_completion_timing_shape(self):
|
||||
processor = object.__new__(LlamaProcessor)
|
||||
client = _WarmupClient(
|
||||
{"choices": [{"message": {"content": '{"cleaned_text":"friday"}'}}]}
|
||||
)
|
||||
processor.client = client
|
||||
|
||||
cleaned_text, timings = processor.process_with_metrics(
|
||||
"thursday, I mean friday",
|
||||
lang="en",
|
||||
dictionary_context="",
|
||||
profile="default",
|
||||
)
|
||||
|
||||
self.assertEqual(cleaned_text, "friday")
|
||||
self.assertEqual(len(client.calls), 1)
|
||||
call = client.calls[0]
|
||||
self.assertEqual(call["messages"][0]["content"], aiprocess.SYSTEM_PROMPT)
|
||||
self.assertIn('{"cleaned_text":"..."}', call["messages"][1]["content"])
|
||||
self.assertEqual(timings.pass1_ms, 0.0)
|
||||
self.assertGreater(timings.pass2_ms, 0.0)
|
||||
self.assertEqual(timings.pass2_ms, timings.total_ms)
|
||||
|
||||
|
||||
class ModelChecksumTests(unittest.TestCase):
|
||||
def test_accepts_expected_checksum_case_insensitive(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue