bigscience-workshop / petals

🌸 Run LLMs at home, BitTorrent-style. Fine-tuning and inference up to 10x faster than offloading
https://petals.dev
MIT License
9.11k stars 512 forks source link

Enhance Speculative Generation with Better Type Hints and Cleaner Code #611

Open mandlinsarah opened 1 month ago

mandlinsarah commented 1 month ago

This PR improves the speculative generation code by adding more explicit type hints, especially for the streamer parameter. Additionally, the code has been refactored for better readability and maintainability. These changes aim to make the code more understandable and slightly more performant without altering the core functionality.