argosopentech / argosopentech/translate-html
Experimental feature Warning (checkpoint = torch.load(filename, lambda storage, loc: storage))
- Dominant language
- Python
- Stars
- 60
- Forks
- 11
- PR merge metrics
- No merged PRs in 30d
Description
`FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
checkpoint = torch.load(filename, lambda storage, loc: storage)`
I was testing normally and then this warning appeared.
this was the code
```
import argostranslate.package, argostranslate.translate
import translatehtml
from_code = "es"
to_code = "en"
html_doc = """
Perro
available_packages = argostranslate.package.get_available_packages()
available_package = list(
filter(
lambda x: x.from_code == from_code and x.to_code == to_code, available_packages
)
)[0]
download_path = available_package.download()
argostranslate.package.install_from_path(download_path)
# Translate
installed_languages = argostranslate.translate.get_installed_languages()
from_lang = list(filter(lambda x: x.code == from_code, installed_languages))[0]
to_lang = list(filter(lambda x: x.code == to_code, installed_languages))[0]
translation = from_lang.get_translation(to_lang)
translated_soup = translatehtml.translate_html(translation, html_doc)
print(translated_soup)
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the warning with the supplied Argos Translate and translatehtml script, then locate the checkpoint = torch.load(filename, lambda storage, loc: storage) call in the project or its dependency path. Check how the checkpoint is used and verify that the warning is addressed without breaking the example translation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100