This function stops the translation process. Inputs: - state: The state of the translation process Returns:- None
(state: dict)
| 179 | |
| 180 | |
| 181 | def stop_translate_file(state: dict) -> None: |
| 182 | """ |
| 183 | This function stops the translation process. |
| 184 | |
| 185 | Inputs: |
| 186 | - state: The state of the translation process |
| 187 | |
| 188 | Returns:- None |
| 189 | """ |
| 190 | session_id = state["session_id"] |
| 191 | if session_id is None: |
| 192 | return |
| 193 | if session_id in cancellation_event_map: |
| 194 | logger.info(f"Stopping translation for session {session_id}") |
| 195 | cancellation_event_map[session_id].set() |
| 196 | |
| 197 | |
| 198 | def translate_file( |