INNER CODE UNIT · Python
progress_percent
mrwadams/stride-gpt · apps/web/main.py:669
progress_percent = 0.2 + (0.8 * (i / file_count))
progress_bar.progress(min(progress_percent, 1.0))
status_text.text(f"Analyzing file {i + 1}/{file_count}: {file.path}")
try:
content = repo.get_contents(file.path, ref=default_branch)
decoded_content = base64.b64decode(content.content).decode()
# Summarize the file content
summary = summarize_file(file.path, decoded_content)
summary_tokens = estimate_tokens(summary, token_estimation_model)
# Check if adding this summary would exceed our token limit
if total_tokens + summary_tokens > analysis_token_limit:
# If we're about to exceed the limit, add a note and stop processing
file_summaries["info"].append(
f"Analysis truncated: {file_count - i} more files not analyzed due to token limit."
)