Skip to content
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

feat: Improve form item and switch to README preview on validation check #2715

Conversation

agatha197
Copy link
Contributor

@agatha197 agatha197 commented Sep 21, 2024

Changes:

This PR updates the ImportFromHuggingFaceModal component and related translations to enhance the user experience when importing models from Hugging Face. Key changes include:

  1. Added new form fields for "Model store folder name" and "Service name".
  2. Implemented a README.md preview card with Markdown support.
  3. Added validation to ensure only LLM models (text-generation pipeline) are supported.
  4. Updated translations for new strings across multiple languages.

Rationale:

These changes provide users with more control over the import process and better information about the model being imported. The README preview allows users to review model details before importing, while the additional form fields enable customization of the import location and service name.

Effects:

  • Users can now specify custom folder names and service names for imported models.
  • The UI now displays a preview of the model's README, improving user understanding of the model before import.
  • The system now restricts imports to LLM models only, preventing potential issues with unsupported model types.
  • Improved localization support for the new features across multiple languages.

Screenshots:

  • Default
    image.png
  • Valid
    image.png
  • Invalid URL
    image.png
  • Not LLM model
    image.png

Checklist:

  • Documentation
  • Test case(s) to demonstrate the difference of before/after

Copy link

graphite-app bot commented Sep 21, 2024

Your org requires the Graphite merge queue for merging into main

Add the label “flow:merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “flow:hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

@github-actions github-actions bot added the size:L 100~500 LoC label Sep 21, 2024
@agatha197 agatha197 force-pushed the feature/improve-form-item-and-switch-to-README-preview-on-validation-check branch from 7bab3a6 to eef5ec0 Compare September 21, 2024 17:19
Comment on lines 161 to 165
disabled={
!shouldSkipURLCheck ||
huggingFaceModelInfo.data?.pipeline_tag! !== 'text-generation'
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
disabled={
!shouldSkipURLCheck ||
huggingFaceModelInfo.data?.pipeline_tag! !== 'text-generation'
}
disabled={
!shouldSkipURLCheck ||
(!_.isEmpty(huggingFaceModelInfo.data?.pipeline_tag) &&
huggingFaceModelInfo.data?.pipeline_tag !== 'text-generation')
}

Copy link
Member

Choose a reason for hiding this comment

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

I just push a change to resolve this part. LGTM now!

@yomybaby yomybaby self-requested a review September 21, 2024 21:19
Copy link
Member

@yomybaby yomybaby left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

graphite-app bot commented Sep 21, 2024

Merge activity

…eck (#2715)

**Changes:**

This PR updates the ImportFromHuggingFaceModal component and related translations to enhance the user experience when importing models from Hugging Face. Key changes include:

1. Added new form fields for "Model store folder name" and "Service name".
2. Implemented a README.md preview card with Markdown support.
3. Added validation to ensure only LLM models (text-generation pipeline) are supported.
4. Updated translations for new strings across multiple languages.

**Rationale:**

These changes provide users with more control over the import process and better information about the model being imported. The README preview allows users to review model details before importing, while the additional form fields enable customization of the import location and service name.

**Effects:**

- Users can now specify custom folder names and service names for imported models.
- The UI now displays a preview of the model's README, improving user understanding of the model before import.
- The system now restricts imports to LLM models only, preventing potential issues with unsupported model types.
- Improved localization support for the new features across multiple languages.

**Screenshots:**
- Default
![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/2HueYSdFvL8pOB5mgrUQ/22e37a3e-2eb1-48dd-b36d-36999677273c.png)
- Valid
![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/2HueYSdFvL8pOB5mgrUQ/cc02186d-b148-4576-b2d1-686e25958bb5.png)
- Invalid URL
![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/2HueYSdFvL8pOB5mgrUQ/2e4e0e40-1295-41e1-86b4-7e00a1049943.png)
- Not LLM model
![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/2HueYSdFvL8pOB5mgrUQ/71bfc317-6295-438f-aeee-3cc4057885bb.png)

**Checklist:**

- [ ] Documentation
- [ ] Test case(s) to demonstrate the difference of before/after
@yomybaby yomybaby force-pushed the feature/fetch-README-file-using-url branch from 3d8fd90 to dc76d4e Compare September 21, 2024 21:20
@yomybaby yomybaby force-pushed the feature/improve-form-item-and-switch-to-README-preview-on-validation-check branch from 45a6d7c to f07e70d Compare September 21, 2024 21:21
Base automatically changed from feature/fetch-README-file-using-url to main September 21, 2024 21:22
@graphite-app graphite-app bot merged commit f07e70d into main Sep 21, 2024
4 checks passed
@graphite-app graphite-app bot deleted the feature/improve-form-item-and-switch-to-README-preview-on-validation-check branch September 21, 2024 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:i18n Localization area:ux UI / UX issue. size:L 100~500 LoC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants