Spaces:
Sleeping
Sleeping
Commit ·
13ce174
1
Parent(s): 4b424d6
fina p3
Browse files- src/inference_logic.py +7 -2
src/inference_logic.py
CHANGED
|
@@ -471,7 +471,7 @@ async def run_vertex_labeling_pipeline(video_path: str, caption: str, transcript
|
|
| 471 |
|
| 472 |
macro_prompt = FCOT_MACRO_PROMPT.format(system_persona=system_persona, caption=caption, transcript=transcript)
|
| 473 |
save_debug_log(request_id, 'prompt', macro_prompt, attempt, 'fcot_macro')
|
| 474 |
-
inputs1 =
|
| 475 |
if video_part: inputs1.insert(0, video_part)
|
| 476 |
else: inputs1[0] = "NOTE: Text Only Analysis.\n" + inputs1[0]
|
| 477 |
|
|
@@ -708,4 +708,9 @@ async def run_nrp_labeling_pipeline(video_path: str, caption: str, transcript: s
|
|
| 708 |
|
| 709 |
if attempt == max_retries:
|
| 710 |
yield f"Max retries reached. Saving incomplete data.\n"
|
| 711 |
-
yield {"raw_toon": full_raw_text, "parsed_data": accumulated_data, "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 471 |
|
| 472 |
macro_prompt = FCOT_MACRO_PROMPT.format(system_persona=system_persona, caption=caption, transcript=transcript)
|
| 473 |
save_debug_log(request_id, 'prompt', macro_prompt, attempt, 'fcot_macro')
|
| 474 |
+
inputs1 =[macro_prompt]
|
| 475 |
if video_part: inputs1.insert(0, video_part)
|
| 476 |
else: inputs1[0] = "NOTE: Text Only Analysis.\n" + inputs1[0]
|
| 477 |
|
|
|
|
| 708 |
|
| 709 |
if attempt == max_retries:
|
| 710 |
yield f"Max retries reached. Saving incomplete data.\n"
|
| 711 |
+
yield {"raw_toon": full_raw_text, "parsed_data": accumulated_data, "prompt_used": prompt_used, "fcot_trace": fcot_trace}
|
| 712 |
+
break
|
| 713 |
+
|
| 714 |
+
except Exception as e:
|
| 715 |
+
yield f"ERROR: {e}"
|
| 716 |
+
logger.error("NRP Labeling Error", exc_info=True)
|