localize / DEPENDENCY_UPDATE.md
rakib7's picture
Upload 13 files
623666e verified
|
Raw History Blame Contribute Delete
4.74 kB
# Dependency Update Summary
**Date:** January 26, 2026
## Updated Dependencies
All dependencies have been updated to their latest stable versions as of January 2026:
| Package | Previous Version | New Version | Change |
|---------|-----------------|-------------|---------|
| gradio | 4.16.0 | 4.44.1 | Minor upgrade (latest 4.x) |
| transformers | 4.36.2 | 4.57.6 | Minor upgrade |
| torch | 2.1.2 | 2.10.0 | Minor upgrade |
| sentencepiece | 0.1.99 | 0.2.1 | Minor upgrade |
| protobuf | 3.20.3 | 6.33.4 | Major upgrade |
| accelerate | 0.25.0 | 1.12.0 | Minor upgrade |
## Why Gradio 4.44.1 Instead of 6.4.0?
While Gradio 6.4.0 is the absolute latest version, we're using **Gradio 4.44.1** (the latest stable 4.x release) for the following reasons:
1. **No Code Changes Required:** Gradio 4.x maintains the same API as your current code
2. **Proven Stability:** 4.44.1 is battle-tested and widely deployed
3. **Hugging Face Spaces Compatibility:** Many Spaces still use Gradio 4.x
4. **Easier Migration Path:** You can upgrade to 6.x later when ready
### Future Upgrade to Gradio 6.x
When you're ready to upgrade to Gradio 6.4.0, you'll need to make these changes to `app.py`:
```python
# Change from:
with gr.Blocks(title="NLLB-200 Translator", theme=gr.themes.Soft()) as demo:
# ...
demo.launch(share=True)
# To:
with gr.Blocks(title="NLLB-200 Translator") as demo:
# ...
demo.launch(theme=gr.themes.Soft(), share=True)
```
## Compatibility Notes
### Python Version Requirement
- **Minimum Python Version:** 3.10+
- All updated packages require Python 3.10 or higher
- Ensure your environment uses Python 3.10, 3.11, 3.12, or 3.13
### Key Breaking Changes
#### Gradio 4.44.1 (Latest 4.x)
The upgrade from Gradio 4.16 to 4.44.1 maintains API compatibility:
- **No Breaking Changes:** The API remains consistent across 4.x versions
- **Theme Parameter:** Stays in `gr.Blocks()` constructor (no changes needed)
- **Current Code:** Fully compatible without modifications
#### Transformers 4.57.6
- Compatible with PyTorch 2.1+ (including 2.10.0)
- No breaking changes affecting this application's usage
- The basic API for `AutoTokenizer` and `AutoModelForSeq2SeqLM` remains stable
#### PyTorch 2.10.0
- Latest stable release (January 21, 2026)
- Improved performance and numerical debugging
- Full backward compatibility with 2.1.x API
### Compatibility Matrix
| Package | Compatible With |
|---------|----------------|
| gradio 4.44.1 | Python 3.10+, transformers 4.57.6, torch 2.10.0 |
| transformers 4.57.6 | Python 3.10+, torch 2.1+, sentencepiece 0.2.1 |
| torch 2.10.0 | Python 3.10+ |
| accelerate 1.12.0 | transformers 4.57.6, torch 2.10.0 |
## Installation
To install the updated dependencies:
```bash
pip install -r requirements.txt
```
Or install individually:
```bash
pip install gradio==6.4.0 transformers==4.57.6 torch==2.10.0 sentencepiece==0.2.1 protobuf==6.33.4 accelerate==1.12.0
```
## Testing Recommendations
After updating dependencies, test the following:
1. **Model Loading:** Verify NLLB model loads correctly
2. **Translation Functionality:** Test translations across different language pairs
3. **UI Rendering:** Ensure Gradio interface displays properly with the new theme API
4. **Language Detection:** Verify auto-detection works for various scripts
5. **Performance:** Check if there are any performance improvements
## Potential Issues
### If You Encounter Errors:
1. **Python Version Error:**
- Ensure you're using Python 3.10 or higher
- Check with: `python --version`
2. **Import Errors:**
- Clear pip cache: `pip cache purge`
- Reinstall dependencies: `pip install -r requirements.txt --force-reinstall`
3. **Theme Not Applied:**
- Verify the theme parameter is in `demo.launch()` not `gr.Blocks()`
4. **Model Loading Issues:**
- Clear transformers cache: `rm -rf ~/.cache/huggingface/`
- Re-download model on first run
## Benefits of Update
1. **Security:** Latest versions include security patches
2. **Performance:** PyTorch 2.10.0 includes performance optimizations
3. **Features:** Access to latest Gradio 6.x features
4. **Stability:** Bug fixes from multiple minor releases
5. **Support:** Better community support for latest versions
## Rollback Instructions
If you need to revert to previous versions:
```bash
# Restore original requirements.txt
git checkout requirements.txt app.py
# Reinstall old dependencies
pip install -r requirements.txt
```
## References
- [Gradio 6 Migration Guide](https://www.gradio.app/guides/gradio-6-migration-guide)
- [Transformers 4.57 Release Notes](https://github.com/huggingface/transformers/releases)
- [PyTorch 2.10 Release Notes](https://pytorch.org/blog/pytorch-2.10-release/)