Fix and clean up a transcript using an LLM model. Args: text_eval_model: The LLM model wrapper to use for fixing the transcript. transcript: The input transcript text to fix. Returns: str: The fixed and cleaned transcript text.
(text_eval_model: Union[LiteLLMWrapper, GeminiWrapper], transcript: str)
| 32 | |
| 33 | |
| 34 | def fix_transcript(text_eval_model: Union[LiteLLMWrapper, GeminiWrapper], transcript: str) -> str: |
| 35 | """ |
| 36 | Fix and clean up a transcript using an LLM model. |
| 37 | |
| 38 | Args: |
| 39 | text_eval_model: The LLM model wrapper to use for fixing the transcript. |
| 40 | transcript: The input transcript text to fix. |
| 41 | |
| 42 | Returns: |
| 43 | str: The fixed and cleaned transcript text. |
| 44 | """ |
| 45 | print("Fixing transcript...") |
| 46 | |
| 47 | prompt = _fix_transcript.format(transcript=transcript) |
| 48 | response = text_eval_model(_prepare_text_inputs(prompt)) |
| 49 | fixed_script = response.split("<SCRIPT>", maxsplit=1)[1].split("</SCRIPT>")[0] |
| 50 | |
| 51 | return fixed_script |
| 52 | |
| 53 | |
| 54 | def evaluate_text(text_eval_model: LiteLLMWrapper, transcript: str, retry_limit: int) -> dict: |
no test coverage detected