-
Notifications
You must be signed in to change notification settings - Fork 63
Update gradio #64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update gradio #64
Conversation
There was a problem hiding this 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.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
…aphGen into update-gradio
There was a problem hiding this 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.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this 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.
There was a problem hiding this 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))) |
Copilot
AI
Oct 16, 2025
There was a problem hiding this comment.
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.
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:
webui/app.pyis 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.WebuiParams.from_list, streamlining how user input is collected and passed to the backend.Partitioning and documentation updates:
Other improvements:
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: