Spaces:
Sleeping
Sleeping
A newer version of the Gradio SDK is available: 6.13.0
Quick Start: Testing Qwen2.5 LLM Translation
π Ready to Test!
Everything is set up. Follow these steps:
1. Install Dependencies
pip install -r requirements.txt
Note: First time will take a few minutes to download packages.
2. Check Everything is Installed
python check_dependencies.py
Should show β for all required packages.
3. Run the Test
python test_llm_translation.py
First run: Will download Qwen2.5-1.5B model (~3GB) - takes 5-10 minutes
Subsequent runs: Uses cached model - much faster
4. Debug in Cursor/VSCode
- Open
test_llm_translation.py - Set a breakpoint (click left of line number)
- Press F5 (or Run β Start Debugging)
- Select "Python: Test LLM Translation"
- Step through code and inspect variables
π Files Created
- β
test_llm_translation.py- Main test script - β
check_dependencies.py- Dependency checker - β
.vscode/launch.json- Debug configurations (local only) - β
LLM_SETUP.md- Detailed setup guide
π Troubleshooting
Missing packages?
pip install -r requirements.txt
bitsandbytes won't install?
- macOS: May need conda or skip quantization
- Windows: Use WSL or skip quantization
- Linux: Usually works fine
Out of memory?
- Use smaller model: Change to
Qwen/Qwen2.5-0.5B-Instructin test script - Or use quantization (already enabled by default)
Model download slow?
- Normal on first run (3GB download)
- Subsequent runs use cache
π What the Test Does
Tests Model Loading
- Loads Qwen2.5-1.5B-Instruct
- Checks memory usage
- Tests basic inference
Tests Translation
- Translates sample Chinese religious texts
- Checks translation quality
- Reports success rate
Provides Detailed Logs
- Shows what's happening
- Reports errors clearly
- Helps with debugging
π― Next Steps After Testing
Once tests pass locally:
- Integrate LLM translation into
document_processing_agent.py - Add toggle between OPUS-MT and LLM
- Test with real documents
- Deploy to HF Spaces
Need help? Check LLM_SETUP.md for detailed guide.