Adapting Language Models to Compress Contexts