This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Step 1: Download ChatGPT history | |
# Go to ChatGPT -> click on profile (...) -> Settings & Beta -> Data controls -> Export data | |
# You should receive a zip by email from OpenAI | |
PATH_TO_EXPORT_CONVERSATION = "" # Set this as the path of the "conversations.json" file in the zip you received | |
# Step 2: Execute this code | |
import pandas as pd | |
import tiktoken | |
encoding = tiktoken.encoding_for_model("gpt-3.5-turbo") |