huggingface / huggingface_hub

The official Python client for the Huggingface Hub.
https://huggingface.co/docs/huggingface_hub
Apache License 2.0
1.82k stars 470 forks source link

null is not defined #2341

Closed tejas36026 closed 2 weeks ago

tejas36026 commented 2 weeks ago

from gradio_client import Client, file

client = Client("yisol/IDM-VTON")
result = client.predict(
        dict={"background":file('https://raw.githubusercontent.com/gradio-app/gradio/main/test/test_files/bus.png'),"layers":[],"composite": null},
        garm_img=file('https://raw.githubusercontent.com/gradio-app/gradio/main/test/test_files/bus.png'),
        garment_des="Hello!!",
        is_checked=True,
        is_checked_crop=False,
        denoise_steps=30,
        seed=42,
        api_name="/tryon"
)
print(result)

when executing this code i am getting null is not defined. and when i change the null to None in this code

from gradio_client import Client, file

client = Client("yisol/IDM-VTON")
result = client.predict(
        dict={"background":file('https://raw.githubusercontent.com/gradio-app/gradio/main/test/test_files/bus.png'),"layers":[],"composite": None},
        garm_img=file('https://raw.githubusercontent.com/gradio-app/gradio/main/test/test_files/bus.png'),
        garment_des="Hello!!",
        is_checked=True,
        is_checked_crop=False,
        denoise_steps=30,
        seed=42,
        api_name="/tryon"
)
print(result)
```   then i am getting this error  `UnicodeEncodeError: 'charmap' codec can't encode character '\u2714' in position 47: character maps to <undefined>`    

### Reproduction

install gradio client and then paste this code. 

### Logs

```shell
UnicodeEncodeError: 'charmap' codec can't encode character '\u2714' in position 47: character maps to <undefined>

System info

huggingface-cli env

Copy-and-paste the text below in your GitHub issue.

- huggingface_hub version: 0.23.1
- Platform: Windows-10-10.0.19045-SP0
- Python version: 3.10.10
- Running in iPython ?: No
- Running in notebook ?: No
- Running in Google Colab ?: No
- Token path ?: C:\Users\tejas\.cache\huggingface\token
- Has saved token ?: True
- FastAI: N/A
- Tensorflow: 2.16.1
- Torch: 2.3.0
- Jinja2: 3.1.4
- Graphviz: N/A
- keras: 3.3.3
- Pydot: N/A
- Pillow: 10.3.0
- hf_transfer: N/A
- gradio: 4.32.2
- tensorboard: N/A
- numpy: 1.26.4
- pydantic: 2.7.3
- aiohttp: 3.9.5
- ENDPOINT: https://huggingface.co
- HF_HUB_CACHE: C:\Users\tejas\.cache\huggingface\hub
- HF_ASSETS_CACHE: C:\Users\tejas\.cache\huggingface\assets
- HF_TOKEN_PATH: C:\Users\tejas\.cache\huggingface\token
- HF_HUB_OFFLINE: False
- HF_HUB_DISABLE_TELEMETRY: False
- HF_HUB_DISABLE_PROGRESS_BARS: None
- HF_HUB_DISABLE_SYMLINKS_WARNING: False
- HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False
- HF_HUB_DISABLE_IMPLICIT_TOKEN: False
- HF_HUB_ENABLE_HF_TRANSFER: False
- HF_HUB_ETAG_TIMEOUT: 10
- HF_HUB_DOWNLOAD_TIMEOUT: 10
Wauplin commented 2 weeks ago

cc @abidlabs @freddyaboulton for the gradio client (not a huggingface_hub issue)

abidlabs commented 2 weeks ago

Hi @tejas36026 can you please open an issue here instead: https://github.com/gradio-app/gradio/issues