Signed-off-by: MoonRide303 <redacted>
# Use huggingface_hub library if available.
# Allows access to gated models if the user has access and ran `huggingface-cli login`.
from huggingface_hub import hf_hub_download
- with open(hf_hub_download(repo_id=model_id, filename="tokenizer_config.json")) as f:
+ with open(hf_hub_download(repo_id=model_id, filename="tokenizer_config.json"), encoding="utf-8") as f:
config_str = f.read()
except ImportError:
import requests