Skip to content

Conversation

@ChenZiHong-Gavin
Copy link
Collaborator

@ChenZiHong-Gavin ChenZiHong-Gavin commented Oct 16, 2025

This pull request introduces significant improvements to the configuration and user interface of the GraphGen web UI, focusing on modularizing configuration options, enhancing partitioning flexibility, and improving usability. The main changes include reorganizing the Gradio UI into clear configuration sections, supporting multiple graph partitioning algorithms with tailored parameters, simplifying parameter passing, and updating documentation for clarity.

UI and configuration improvements:

  • The Gradio interface in webui/app.py is refactored to use separate accordions for Split, Quiz & Judge, Partition, and Generation configurations, each with detailed controls and help text. Partitioning now supports multiple algorithms (dfs, bfs, ece, leiden), each exposing only relevant parameters, improving user experience and reducing confusion.
  • The parameter passing logic is simplified by introducing WebuiParams.from_list, streamlining how user input is collected and passed to the backend.
  • The backend now dynamically constructs partition parameters based on the selected method, allowing flexible and maintainable support for different partitioning strategies. [1] [2]

Partitioning and documentation updates:

  • The configuration files and partitioner docstrings are updated to use "unit sampling" instead of "edge sampling", reflecting the new focus on partitioning by units (nodes/edges) rather than just edges. [1] [2] [3]
  • The README and Chinese README are updated with instructions for hot-reloading during development, aiding contributors. [1] [2]

Other improvements:

  • Minor UI tweaks, such as adjusting default token per minute values and improving markdown rendering, enhance usability. [1] [2]
  • The Gradio demo launch parameters are updated for better deployment defaults.
  • Preparatory changes for dataclass field introspection are made in webui/base.py.

These changes collectively make the web UI more modular, flexible, and user-friendly, while also clarifying the partitioning logic and improving maintainability.

References:

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Refactors the Gradio web UI into modular accordions with internationalized labels, updates partitioning terminology from edge to unit sampling across code and configs, and adds development hot-reload documentation. Key changes focus on UI restructuring, translation additions, and terminology/doc updates.

  • Modular partition, split, quiz, and generation configuration sections with dynamic parameter groups.
  • Terminology shift to “unit sampling” reflected in configs and partitioner docstring (partially inconsistent).
  • Added hot-reload instructions in both README files and expanded translation keys.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
webui/translation.json Added extensive new i18n keys for UI tooltips and labels; updated headings and terminology.
webui/app.py Reorganized UI into multiple accordions; removed deprecated controls; added dynamic partition method parameter groups; adjusted launch settings.
graphgen/models/partitioner/ece_partitioner.py Updated docstring wording from edges to units (partially inconsistent).
graphgen/configs/multi_hop_config.yaml Comment updated to “unit sampling strategy”.
graphgen/configs/aggregated_config.yaml Comment updated to “unit sampling strategy”.
README_ZH.md Added hot-reload usage instructions.
README.md Added hot-reload usage instructions.

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@ChenZiHong-Gavin ChenZiHong-Gavin marked this pull request as ready for review October 16, 2025 08:28
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Comments suppressed due to low confidence (2)

webui/base.py:6

  • WebuiParams is not decorated with @DataClass, so dataclasses.fields(cls) will raise a TypeError and cls(**...) will fail (no generated init). Add @DataClass above the class definition.
class WebuiParams:

webui/app.py:160

  • Previously when the trainee model was disabled, edge/unit sampling was forced to 'random'; that fallback logic has been removed. If users select 'max_loss' or 'min_loss' without running quiz_and_judge, comprehension loss data may be unavailable. Reinstate a conditional forcing unit_sampling='random' when if_trainee_model is False.
        graph_gen.insert(read_config=config["read"], split_config=config["split"])

        if config["if_trainee_model"]:
            graph_gen.quiz_and_judge(quiz_and_judge_config=config["quiz_and_judge"])

        graph_gen.generate(
            partition_config=config["partition"],
            generate_config=config["generate"],

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.

Comments suppressed due to low confidence (2)

graphgen/operators/generate/generate_qas.py:43

  • Mode matching is case-sensitive and excludes the UI value 'CoT'; this mismatch causes a ValueError. Normalize input (e.g., mode = mode.lower()) or align UI to provide 'cot'.
    mode = generation_config["mode"]
    logger.info("[Generation] mode: %s, batches: %d", mode, len(batches))

    if mode == "atomic":
        generator = AtomicGenerator(llm_client)
    elif mode == "aggregated":
        generator = AggregatedGenerator(llm_client)
    elif mode == "multi_hop":
        generator = MultiHopGenerator(llm_client)
    elif mode == "cot":
        generator = CoTGenerator(llm_client)
    else:
        raise ValueError(f"Unsupported generation mode: {mode}")

graphgen/utils/run_concurrent.py:1

  • Large blocks of obsolete commented implementations add noise; removing them or moving alternative patterns to documentation will improve readability and reduce confusion.
import asyncio

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

trainee_api_key=args[23],
token_counter=args[24],
)
WebuiParams(**dict(zip(WebuiParams.__annotations__, args)))
Copy link

Copilot AI Oct 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WebuiParams lacks an init (no @DataClass or manual constructor shown), so calling it with keyword arguments will raise TypeError; additionally, relying on annotations ordering for positional arg mapping is fragile. Convert WebuiParams into a @DataClass (or define an explicit init) and replace this with WebuiParams.from_list(args) that maps inputs deterministically (e.g., using a fixed ordered field list) to avoid silent misalignment.

Copilot uses AI. Check for mistakes.
@ChenZiHong-Gavin ChenZiHong-Gavin merged commit a2f2b80 into main Oct 16, 2025
3 checks passed
@ChenZiHong-Gavin ChenZiHong-Gavin deleted the update-gradio branch October 16, 2025 11:35
CHERRY-ui8 pushed a commit to CHERRY-ui8/GraphGen that referenced this pull request Dec 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants