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.26k stars 524 forks source link

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

Open mandlinsarah opened 3 months ago

mandlinsarah commented 3 months 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.