JialiangZhu commited on
Commit
71f0b10
·
1 Parent(s): fd366ed

Update UI layout and assets

Browse files
Files changed (4) hide show
  1. .gitattributes +1 -0
  2. .gitignore +1 -0
  3. README.md +2 -0
  4. app.py +67 -37
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ *.png filter=lfs diff=lfs merge=lfs -text
.gitignore CHANGED
@@ -4,4 +4,5 @@
4
  .vscode
5
 
6
  __pycache__/
 
7
 
 
4
  .vscode
5
 
6
  __pycache__/
7
+ image/*.png
8
 
README.md CHANGED
@@ -12,4 +12,6 @@ hf_oauth_scopes:
12
  - inference-api
13
  ---
14
 
 
 
15
  An example chatbot using [Gradio](https://gradio.app), [`huggingface_hub`](https://huggingface.co/docs/huggingface_hub/v0.22.2/en/index), and the [Hugging Face Inference API](https://huggingface.co/docs/api-inference/index).
 
12
  - inference-api
13
  ---
14
 
15
+ Paper: https://arxiv.org/abs/2602.02486
16
+
17
  An example chatbot using [Gradio](https://gradio.app), [`huggingface_hub`](https://huggingface.co/docs/huggingface_hub/v0.22.2/en/index), and the [Hugging Face Inference API](https://huggingface.co/docs/api-inference/index).
app.py CHANGED
@@ -588,43 +588,73 @@ def reset():
588
 
589
  with gr.Blocks() as demo:
590
  gr.Markdown("## RE-TRAC (REcursive TRAjectory Compression) 30B Demo")
591
- gr.Markdown(f"Config: `{CONFIG_PATH}`")
592
-
593
- chatbot_kwargs = {"height": 520, "label": "Messages (full stream)"}
594
- if CHATBOT_SUPPORTS_GROUPING:
595
- chatbot_kwargs["group_consecutive_messages"] = False
596
- if CHATBOT_SUPPORTS_MESSAGES:
597
- chatbot = gr.Chatbot(type="messages", **chatbot_kwargs)
598
- else:
599
- chatbot = gr.Chatbot(**chatbot_kwargs)
600
- # #region agent log
601
- try:
602
- attr_type = getattr(chatbot, "type", None)
603
- attr_format = getattr(chatbot, "format", None)
604
- attr_data_format = getattr(chatbot, "data_format", None)
605
- CHATBOT_EXPECTS_MESSAGES = _should_use_messages_format() or (
606
- (attr_type == "messages") or (attr_format == "messages") or (attr_data_format == "messages")
607
- )
608
- _debug_log(
609
- "chatbot instance attrs",
610
- {
611
- "attr_type": attr_type,
612
- "attr_format": attr_format,
613
- "attr_data_format": attr_data_format,
614
- "expects_messages": CHATBOT_EXPECTS_MESSAGES,
615
- },
616
- "H1",
617
- )
618
- except Exception:
619
- pass
620
- # #endregion
621
- status = gr.Markdown("Idle.")
622
-
623
- ui_state = gr.State(None)
624
-
625
- query = gr.Textbox(label="Query (only once)", placeholder="Enter your query and press Run")
626
- run_btn = gr.Button("Run", variant="primary")
627
- reset_btn = gr.Button("Reset")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
628
 
629
  run_btn.click(
630
  run_once,
 
588
 
589
  with gr.Blocks() as demo:
590
  gr.Markdown("## RE-TRAC (REcursive TRAjectory Compression) 30B Demo")
591
+ with gr.Row():
592
+ with gr.Column(scale=6):
593
+ gr.Markdown(f"Config: `{CONFIG_PATH}`")
594
+
595
+ chatbot_kwargs = {"height": 520, "label": "Messages (full stream)"}
596
+ if CHATBOT_SUPPORTS_GROUPING:
597
+ chatbot_kwargs["group_consecutive_messages"] = False
598
+ if CHATBOT_SUPPORTS_MESSAGES:
599
+ chatbot = gr.Chatbot(type="messages", **chatbot_kwargs)
600
+ else:
601
+ chatbot = gr.Chatbot(**chatbot_kwargs)
602
+ # #region agent log
603
+ try:
604
+ attr_type = getattr(chatbot, "type", None)
605
+ attr_format = getattr(chatbot, "format", None)
606
+ attr_data_format = getattr(chatbot, "data_format", None)
607
+ CHATBOT_EXPECTS_MESSAGES = _should_use_messages_format() or (
608
+ (attr_type == "messages") or (attr_format == "messages") or (attr_data_format == "messages")
609
+ )
610
+ _debug_log(
611
+ "chatbot instance attrs",
612
+ {
613
+ "attr_type": attr_type,
614
+ "attr_format": attr_format,
615
+ "attr_data_format": attr_data_format,
616
+ "expects_messages": CHATBOT_EXPECTS_MESSAGES,
617
+ },
618
+ "H1",
619
+ )
620
+ except Exception:
621
+ pass
622
+ # #endregion
623
+ status = gr.Markdown("Idle.")
624
+
625
+ ui_state = gr.State(None)
626
+
627
+ query = gr.Textbox(label="Query (only once)", placeholder="Enter your query and press Run")
628
+ run_btn = gr.Button("Run", variant="primary")
629
+ reset_btn = gr.Button("Reset")
630
+ with gr.Column(scale=4):
631
+ gr.Markdown(
632
+ """
633
+ ## Introduction
634
+ We introduce Re-TRAC, a recursive framework that resolves the inefficiency of isolated trials in agentic search. It not only boosts both commercial and open-source models by 15–20% over ReAct on BrowseComp but also drives SFT-only performance to new heights (30% for 4B, 53% for 30B).
635
+
636
+ </div>
637
+ <p align="center">
638
+ 🤗 <a href="https://github.com/microsoft/InfoAgent/tree/main/retrac">HuggingFace(comming soon)</a> |
639
+ 💻 <a href="https://github.com/microsoft/InfoAgent/tree/main/retrac">GitHub</a> |
640
+ 📑 <a href="https://arxiv.org/abs/2602.02486">Paper</a> |
641
+ 🌐 <a href="https://huggingface.co/spaces/JialiangZhu/RE-TRAC">Demo</a>
642
+ </p>
643
+
644
+ ## Method Overview
645
+ """
646
+ )
647
+ gr.Image(
648
+ value="image/method.png",
649
+ label="Method Overview",
650
+ show_label=False,
651
+ )
652
+ gr.Markdown("## Main Result")
653
+ gr.Image(
654
+ value="image/main_table.png",
655
+ label="Main Result",
656
+ show_label=False,
657
+ )
658
 
659
  run_btn.click(
660
  run_once,