gradio-app / gradio

Build and share delightful machine learning apps, all in Python. 🌟 Star to support our work!
http://www.gradio.app
Apache License 2.0
32.62k stars 2.45k forks source link

gradio cc build completed but custom component not work #9610

Open ThanhHung2112 opened 15 hours ago

ThanhHung2112 commented 15 hours ago

Describe the bug

Hi team, I created a custom component from the Dataset template. I completed the configuration and ran "gradio cc build" without any errors. However, when I installed the component, it turned out to be exactly the same as the original Dataset component. I tried making some minor changes like the background color style, but it still didn't work, even though the build section completed successfully.

Have you searched existing issues? πŸ”Ž

Reproduction

[build-system]
requires = [
  "hatchling",
  "hatch-requirements-txt",
  "hatch-fancy-pypi-readme>=22.5.0",
]
build-backend = "hatchling.build"

[project]
name = "gradio_dataset"
version = "0.0.2"
description = "Python library for easily interacting with trained machine learning models"
readme = "README.md"
license = "Apache-2.0"
requires-python = ">=3.8"
authors = [{ name = "thenHung", email = "email" }]
keywords = [
  "gradio-custom-component",
  "gradio-template-Dataset"
]
# Add dependencies here
dependencies = ["gradio>=4.44.1,<5.0", "gradio-modal-component>=0.0.4,<1.0"]
classifiers = [
  'Development Status :: 3 - Alpha',
  'Operating System :: OS Independent',
  'Programming Language :: Python :: 3',
  'Programming Language :: Python :: 3 :: Only',
  'Programming Language :: Python :: 3.8',
  'Programming Language :: Python :: 3.9',
  'Programming Language :: Python :: 3.10',
  'Programming Language :: Python :: 3.11',
  'Topic :: Scientific/Engineering',
  'Topic :: Scientific/Engineering :: Artificial Intelligence',
  'Topic :: Scientific/Engineering :: Visualization',
]

# The repository and space URLs are optional, but recommended.
# Adding a repository URL will create a badge in the auto-generated README that links to the repository.
# Adding a space URL will create a badge in the auto-generated README that links to the space.
# This will make it easy for people to find your deployed demo or source code when they
# encounter your project in the wild.

# [project.urls]
# repository = "your github repository"
# space = "your space url"

[project.optional-dependencies]
dev = ["build", "twine"]

[tool.hatch.build]
artifacts = ["/backend/gradio_dataset/templates", "*.pyi"]

[tool.hatch.build.targets.wheel]
packages = ["/backend/gradio_dataset"]

Screenshot

No response

Logs

πŸ“¦ Building package in dataset_component                                                                                                                                                                                                                                                                               β”‚
β”‚ πŸ”’ Package will use version 0.0.2 defined in pyproject.toml file. Set --bump-version to automatically bump the version number.                                                                                                                                                                                         β”‚
β”‚ βœ… Documentation generated in demo/space.py and README.md. Pass --no-generate-docs to disable auto documentation.                                                                                                                                                                                                      β”‚
β”‚ 🎨 Building frontend                                                                                                                                                                                                                                                                                                   β”‚
β”‚ βœ… Build succeeded!                                                                                                                                                                                                                                                                                                    β”‚
β”‚ πŸ‘· Building... (/home/lthun/anaconda3/envs/gradio3/bin/python3 -m build /home/lthun/linux_workspace/gradio_lib/dataset_component)                                                                                                                                                                                      β”‚
β”‚ βœ… Build succeeded!                                                                                                                                                                                                                                                                                                    β”‚
β”‚ 🎑 Wheel located in /home/lthun/linux_workspace/gradio_lib/dataset_component/dist                                                                                                                                                                                                                                      β”‚
╰─────────────────────────────────────────────────────────────────────────────────────────────

System Info

gradio==4.44.1
python==3.10
ubuntu==22.04

Severity

I can work around it

freddyaboulton commented 4 hours ago

So you installed from the wheel in ./dist? What is the demo you're running?