Skip to content

feat(shared): add Transformers and Datasets quickstart snippets tab to RepoClone - #1548

Open
sabhi128 wants to merge 2 commits into
OpenCSGs:mainfrom
sabhi128:feat-transformers-quickstart-snippets
Open

sabhi128 wants to merge 2 commits into
OpenCSGs:mainfrom
sabhi128:feat-transformers-quickstart-snippets

Conversation

@sabhi128

Copy link
Copy Markdown
Contributor

Summary of Changes

This PR introduces ready-to-run Python quickstart snippets into the repository Clone/Download modal (RepoClone.vue) for models and datasets.

Key Enhancements:

  1. Quickstart Tab (quickstart):
    • For Models: Displays ready-to-use Python snippet with transformers (AutoTokenizer, AutoModelForCausalLM).
    • For Datasets: Displays datasets library loading snippet (load_dataset).
    • Dynamically injects the current repository path (namespace/name).
  2. Internationalization (i18n):
    • Added translations in English, Simplified Chinese, and Traditional Chinese (all.transformersTips, all.datasetsLibraryTips, all.quickstartTips).
  3. Unit Tests:
    • Added test coverage in RepoClone.spec.js asserting that model and dataset code snippets render properly.

Copilot AI lite review requested due to automatic review settings September 17, 2026 13:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The added model quickstart snippet recommends trust_remote_code=True by default, which is an unsafe default that can execute untrusted repository code.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

This PR adds a new “Quickstart” tab to the repository Clone/Download modal to show ready-to-copy Python snippets for model and dataset repositories, alongside supporting i18n strings and unit tests.

Changes:

  • Added a conditional “Quickstart” tab in RepoClone.vue that shows Transformers (models) or Datasets (datasets) Python code snippets.
  • Added new i18n strings for the quickstart header and library tips (EN / zh-Hans / zh-Hant).
  • Added unit tests to verify the generated markdown includes the expected snippet content.
File summaries
File Description
frontend/src/components/shared/RepoClone.vue Adds the new “Quickstart” tab UI and computed markdown snippet generation for models/datasets.
frontend/src/components/tests/shared/RepoClone.spec.js Adds tests asserting quickstart snippet markdown is generated correctly for model/dataset repo types.
frontend/src/locales/en_js/all.js Adds English i18n strings for the new quickstart tips and header.
frontend/src/locales/zh_js/all.js Adds Simplified Chinese i18n strings for the new quickstart tips and header.
frontend/src/locales/zh_hant_js/all.js Adds Traditional Chinese i18n strings for the new quickstart tips and header.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread frontend/src/components/shared/RepoClone.vue
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