Skip to content

Instantly share code, notes, and snippets.

View Mapagmataas1331's full-sized avatar
๐Ÿ‘€
ma

Mapagmataas Mapagmataas1331

๐Ÿ‘€
ma
View GitHub Profile
@Mapagmataas1331
Mapagmataas1331 / get_files_forGPT.py
Last active August 23, 2024 19:02
This script scans directories, visualizes their structure, reads file contents, and splits them based on GPT model token limits. It saves the processed output in a text file, making it ideal for preparing data for language models.
import os
import tiktoken
GPT_MODELS = {
# "gpt-3.5-turbo": 4096,
# "gpt-3.5-turbo-16k": 16384,
# "gpt-4o": 4096,
"gpt-4o": 4000,
# "gpt-4": 8192,
# "gpt-4-32k": 32768,