Closed weigary closed 3 weeks ago
It seems the API response has been changed to:
https://huggingface.co/api/models/google/gemma-2-27b?securityStatus=1
"securityRepoStatus": {
"scansDone": false,
"filesWithIssues": []
},
Is it a long-term change?
Hello. @weigary Do you have any new information on this issue?
Hello @weigary, one of the maintainers of huggingface_hub
here 🤗
The issue comes from the fact that the securityStatus
field was recently renamed to securityRepoStatus
on the server side. we've just shipped a patch release (v0.26.2) to fix this where we added a proper field to access a model's security scan status in ModelInfo
:
first you will need to upgrade to huggingface_hub==0.26.2
:
pip install huggingface_hub==0.26.2
then, you will be able to access model's scan status using ModelInfo.security_repo_status
field :
from huggingface_hub import HfApi
hf_api = HfApi(
endpoint="https://huggingface.co",
)
model_info = hf_api.model_info(repo_id="google/gemma-2-27b", securityStatus=True)
print(model_info.security_repo_status)
Thank you Celina. I am using the model_info.securityRepoStatus
which seems to work for now. I will update my code to start using the model_info.security_repo_status
!
Mark it as closed.
Hi HF team,
We used to use the
hf_api.model_info().securityStatus
to check if the model repo contains any unsafe files, see the sample call belowIt stopped working as we found it today.
Error message:
Still investigating, but it seems it is not related to the version of the huggingface_hub libarary version. For example, the latest lib version in Google3 is 0.25.1, while the previous version is 0.24.6, which is the version we found it was working. However, even if we downgrade the lib version to 0.24.6, the same API call still does not work.