PyThaiNLP / PyThaiNLP/PyThaiTTS
Model "pythainlp/thaitts-onnx" in this repository requires validation
Nobody has claimed this yet.
- Dominant language
- Jupyter Notebook
- Stars
- 82
- Forks
- 15
- Avg merge
- 28m
- Merged PRs (30d)
- 1
Description
Hi, @wannaphong, I'd like to report that a potentially risky pretrained models are being used in this project, which may pose backdoor threats. Please check the following code example:
• pythaitts/pretrained/lunarlist_onnx.py
class LunarlistONNX:
def __init__(self) -> None:
self.encoder = ort.InferenceSession(hf_hub_download(repo_id="pythainlp/thaitts-onnx",filename="tacotron2encoder-th.onnx"))
self.decoder = ort.InferenceSession(hf_hub_download(repo_id="pythainlp/thaitts-onnx",filename="tacotron2decoder-th.onnx"))
self.postnet = ort.InferenceSession(hf_hub_download(repo_id="pythainlp/thaitts-onnx",filename="tacotron2postnet-th.onnx"))
self.hifi = ort.InferenceSession(hf_hub_download(repo_id="pythainlp/thaitts-onnx",filename="vocoder.onnx"))
def tts(self, text: str):
mel = inference(text, self.encoder, self.decoder, self.postnet)
return self.hifi.run(None, {"spec": mel[0]})
Issue Description
As shown above, in the pythaitts/pretrained/lunarlist_onnx.py, the model "pythainlp/thaitts-onnx" is used as the default model parameter in the hf_hub_download method and download all onnx files. Finally the tacotron2decoder-th.onnx file runs via self.hifi.run.
At the same time, the model is flagged as risky on the HuggingFace platform. The encode.onnx files in these models are marked as risky and may trigger backdoor threats. For certain specific inputs, the backdoor in the models could be activated, effectively altering the model's behavior.
Related Risk Reports::model risk report
Suggested Repair Methods
- Convert the model to safer safetensors format and re-upload
- Try to regenerate the model using the latest onnx library
- Visually inspect the model using OSS tools like Netron. If no issues are found, report the false threat to the scanning platform
As a popular machine learning libraries, every potential risk could be propagated and amplified. Could you please address the above issues?
Thanks for your help~
Best regards,
Mendy
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading pythaitts/pretrained/lunarlist_onnx.py and the linked Hugging Face model risk report, then trace which downloaded ONNX files are used by the inference sessions. Confirm whether the reported model files present a real risk and document the maintainer-approved mitigation or replacement. Done means the risk is resolved or explicitly assessed with a safe disposition.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100