Update app.py
Browse files347 unmodified lines348349350351352353354355356357358359360361362363347 unmodified linesreturn all_resultsdef estimate_tokens(text):# A more accurate estimation (still an estimate, but better than 1 token = 4 chars)return len(text.split())def truncate_text(text, max_tokens):words = text.split()if len(words) <= max_tokens:return textreturn ' '.join(words[:max_tokens])def estimate_tokens(text):return len(text.split())347 unmodified lines348349350351352353347 unmodified linesreturn all_resultsdef estimate_tokens(text):return len(text.split())
app.py-10