Skip to content

Instantly share code, notes, and snippets.

View qfeuilla's full-sized avatar
✍️
Working on exciting projects

Quentin FEUILLADE--MONTIXI qfeuilla

✍️
Working on exciting projects
View GitHub Profile
@qfeuilla
qfeuilla / Extract_info_from_chatgpt_logs.py
Last active August 22, 2023 17:43
Extract info from ChatGPT history
# 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")