Spaces:
Sleeping
Sleeping
Add Stage 4 for Conclusion
Browse files- app.py +11 -1
- prompts/stage4.txt +2 -0
app.py
CHANGED
@@ -381,9 +381,19 @@ class PoseEstimationApp:
|
|
381 |
prompt3 = prompt3.replace("[RESULTS]", evaluator_output)
|
382 |
out_stage3 = self.query_llm(prompt3, use_history=True)
|
383 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
384 |
progress(1.0, desc=self.processing_steps[7])
|
385 |
# 返回最终文本、持久化保存的视频路径、下采样率
|
386 |
-
return
|
387 |
except Exception as e:
|
388 |
# 出错返回三个值,其中视频路径和下采样率为 None
|
389 |
return "Processing error: " + str(e), None, None
|
|
|
381 |
prompt3 = prompt3.replace("[RESULTS]", evaluator_output)
|
382 |
out_stage3 = self.query_llm(prompt3, use_history=True)
|
383 |
|
384 |
+
stage4_path = os.path.join("prompts", "stage4.txt")
|
385 |
+
if not os.path.exists(stage4_path):
|
386 |
+
raise RuntimeError("Missing prompts/stage4.txt prompt file")
|
387 |
+
with open(stage4_path, 'r', encoding='utf-8') as f:
|
388 |
+
prompt4 = f.read()
|
389 |
+
prompt4 = prompt4.replace("[RESULTS]", evaluator_output)
|
390 |
+
out_stage4 = self.query_llm(prompt4, use_history=True)
|
391 |
+
|
392 |
+
|
393 |
+
|
394 |
progress(1.0, desc=self.processing_steps[7])
|
395 |
# 返回最终文本、持久化保存的视频路径、下采样率
|
396 |
+
return out_stage4, persistent_path, downsample_rate
|
397 |
except Exception as e:
|
398 |
# 出错返回三个值,其中视频路径和下采样率为 None
|
399 |
return "Processing error: " + str(e), None, None
|
prompts/stage4.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
### 🧩 Step 4: 总结
|
2 |
+
请总结你在过去所得到的结论,将他们整理为更方便理解的文字,并忽略包括布尔值和评估器这样的中间结果。注意,请使用中文作为最后的返回语言。
|