write dict gpt to file