Repository Analysis

mlfoundations/open_clip

An open source implementation of CLIP.

27.0 Moderate AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of mlfoundations/open_clip, a Python project with 13,982 GitHub stars. SynthScan v2.0 examined 44,560 lines of code across 341 source files, recording 891 pattern matches distributed across 15 syntactic categories. The overall adjusted score of 27.0 places this repository in the Moderate AI signal band.

The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).

27.0
Adjusted Score
27.0
Raw Score
100%
Time Factor
2026-07-13
Last Push
14.0K
Stars
Python
Language
44.6K
Lines of Code
341
Files
891
Pattern Hits
2026-07-14
Scan Date
0.02
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.

Severity Breakdown

Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.

CRITICAL 0HIGH 7MEDIUM 103LOW 781

Directory Score Breakdown

This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.

Pattern Findings

The scanner identified 891 distinct pattern matches across 15 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.

Hyper-Verbose Identifiers516 hits · 537 pts
SeverityFileLineSnippetContext
LOWtests/test_audio_zero_shot.py87def test_hf_audio_dataset_wrapper_and_classnames():CODE
LOWtests/test_audio_zero_shot.py101def test_hf_audio_dataset_wrapper_accepts_decoder_like_audio():CODE
LOWtests/test_audio_zero_shot.py116def test_build_hf_audio_zero_shot_dataset_defaults_to_no_workers(monkeypatch):CODE
LOWtests/test_audio_zero_shot.py152def test_build_hf_audio_zero_shot_dataset_sets_worker_context(monkeypatch):CODE
LOWtests/test_audio_zero_shot.py189def test_run_audio_zero_shot_classifier():CODE
LOWtests/test_audio_zero_shot.py219def test_audio_zero_shot_template_validation():CODE
LOWtests/test_audio_zero_shot.py229def test_run_audio_zero_shot_classifier_uses_bare_model_dummy_audio(monkeypatch):CODE
LOWtests/test_hf_model.py21def test_max_pooler_ignores_padding():CODE
LOWtests/test_hf_model.py29def test_modernbert_hf_text_encoder_supported():CODE
LOWtests/test_hf_model.py55def test_modernbert_does_not_request_hf_pooling_layer():CODE
LOWtests/test_hf_model.py63def test_hf_text_encoder_ignores_config_pinned_dtype():CODE
LOWtests/test_hf_model.py90def test_pretrained_text_encoder(model_id):CODE
LOWtests/test_naflex_timm_conversion.py46def _tiny_native_vit_clip_config():CODE
LOWtests/test_naflex_timm_conversion.py67def _tiny_native_vit_quickgelu_clip_config():CODE
LOWtests/test_naflex_timm_conversion.py100def _write_tiny_big_vision_npz(path):CODE
LOWtests/test_naflex_timm_conversion.py167def test_force_naflex_vision_passes_use_naflex_to_timm(monkeypatch):CODE
LOWtests/test_naflex_timm_conversion.py186def test_force_naflex_vision_accepts_timm_models_by_module_membership():CODE
LOWtests/test_naflex_timm_conversion.py193def test_force_naflex_vision_configures_pe_core_timm_tower():CODE
LOWtests/test_naflex_timm_conversion.py206def test_force_naflex_vision_converts_native_vit_config():CODE
LOWtests/test_naflex_timm_conversion.py222def test_force_naflex_vision_rejects_non_vit_model():CODE
LOWtests/test_naflex_timm_conversion.py231def test_parse_use_naflex_enables_timm_naflex_aug_cfg():CODE
LOWtests/test_naflex_timm_conversion.py239def test_parse_force_naflex_vision_does_not_enable_naflex_data_pipeline():CODE
LOWtests/test_naflex_timm_conversion.py248def test_naflex_data_config_defaults_to_model_patch_size():CODE
LOWtests/test_naflex_timm_conversion.py317def test_convert_naflex_timm_state_dict_maps_patch_embed_weight():CODE
LOWtests/test_naflex_timm_conversion.py346def test_convert_naflex_native_vit_state_dict_folds_class_pos_embed():CODE
LOWtests/test_naflex_timm_conversion.py386def test_force_naflex_native_vit_dense_output_matches_native(monkeypatch, config_fn):CODE
LOWtests/test_task_specific_unit.py84def test_clip_task_loss_aggregation():CODE
LOWtests/test_task_specific_unit.py94def test_clip_task_logit_scale_in_report():CODE
LOWtests/test_task_specific_unit.py108def test_coca_build_loss_inputs_autoregressive_shift():CODE
LOWtests/test_task_specific_unit.py132def test_coca_training_forward_produces_loss():CODE
LOWtests/test_task_specific_unit.py142def test_coca_compute_accum_loss_concatenates_batches():CODE
LOWtests/test_task_specific_unit.py175def test_distill_teacher_frozen():CODE
LOWtests/test_task_specific_unit.py184def test_distill_teacher_stays_eval():CODE
LOWtests/test_task_specific_unit.py193def test_distill_training_forward_prefixes_teacher_outputs():CODE
LOWtests/test_task_specific_unit.py215def test_distill_teacher_no_grad():CODE
LOWtests/test_audio_model_configs.py10def test_clap_htsat_tiny_config_instantiates_with_audio_deps():CODE
LOWtests/test_context_masking.py26def test_mammut_decoder_context_padding_invariant(model_name):CODE
LOWtests/test_context_masking.py47def test_coca_decoder_context_padding_invariant(model_name):CODE
LOWtests/test_context_masking.py67def test_context_masking_all_invalid_row_no_nan():CODE
LOWtests/test_context_masking.py80def test_context_attn_mask_from_valid():CODE
LOWtests/test_clap_task.py78def test_clap_task_training_forward_returns_loss():CODE
LOWtests/test_clap_task.py87def test_clap_task_eval_forward_keeps_audio_features_key():CODE
LOWtests/test_clap_task.py95def test_clap_task_eval_forward_accepts_text_kwargs():CODE
LOWtests/test_clap_task.py103def test_clap_task_dummy_batch_and_batch_size():CODE
LOWtests/test_clap_task.py114def test_clap_task_accum_loss_maps_audio_features_to_clip_loss():CODE
LOWtests/test_clap_task.py125def test_create_task_dispatches_clap(monkeypatch):CODE
LOWtests/test_clap_task.py151def test_factory_dispatches_audio_config_to_clap(tmp_path, monkeypatch):CODE
LOWtests/test_clap_task.py191def test_evaluate_uses_task_primary_key_for_audio():CODE
LOWtests/test_clap_task.py221def test_audio_checkpoint_retries_only_weights_only_payload_errors(monkeypatch):CODE
LOWtests/test_clap_task.py237def test_audio_checkpoint_does_not_retry_unrelated_unpickle_errors(monkeypatch):CODE
LOWtests/test_naflex_audio.py45def test_mel_to_patches_pads_time_remainder_not_truncated():CODE
LOWtests/test_naflex_audio.py57def test_mel_to_patches_subpatch_clip_yields_one_valid_patch():CODE
LOWtests/test_naflex_audio.py67def test_mel_to_patches_pad_modes():CODE
LOWtests/test_naflex_audio.py85def test_mel_patch_embed_forward():CODE
LOWtests/test_naflex_audio.py94def test_audio_patch_dicts_collate_via_existing_naflex_collator():CODE
LOWtests/test_naflex_audio.py106def test_audio_coords_feed_existing_position_builders():CODE
LOWtests/test_naflex_audio.py132def test_audio_patchify_transform_variable_duration():CODE
LOWtests/test_zero_shot_eval.py29def test_zero_shot_eval_handles_already_unwrapped_model(monkeypatch):CODE
LOWtests/test_zero_shot_eval.py77def test_zero_shot_eval_unwraps_wrapped_model_once(monkeypatch):CODE
LOWtests/test_zero_shot_eval.py125def test_zero_shot_eval_skips_generative_model_without_text_tower():CODE
456 more matches not shown…
Decorative Section Separators88 hits · 348 pts
SeverityFileLineSnippetContext
MEDIUMtests/test_task_specific_unit.py14# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_task_specific_unit.py16# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_task_specific_unit.py79# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_task_specific_unit.py81# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_task_specific_unit.py103# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_task_specific_unit.py105# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_task_specific_unit.py170# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_task_specific_unit.py172# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_naflex_genlip.py35# ---------------------------------------------------------------------------------------------------------------------COMMENT
MEDIUMtests/test_naflex_genlip.py37# ---------------------------------------------------------------------------------------------------------------------COMMENT
MEDIUMtests/test_naflex_genlip.py90# ---------------------------------------------------------------------------------------------------------------------COMMENT
MEDIUMtests/test_naflex_genlip.py92# ---------------------------------------------------------------------------------------------------------------------COMMENT
MEDIUMtests/test_naflex_genlip.py124# ---------------------------------------------------------------------------------------------------------------------COMMENT
MEDIUMtests/test_naflex_genlip.py126# ---------------------------------------------------------------------------------------------------------------------COMMENT
MEDIUMtests/test_naflex_genlip.py169# ---------------------------------------------------------------------------------------------------------------------COMMENT
MEDIUMtests/test_naflex_genlip.py171# ---------------------------------------------------------------------------------------------------------------------COMMENT
MEDIUMtests/test_naflex_genlip.py180# ---------------------------------------------------------------------------------------------------------------------COMMENT
MEDIUMtests/test_naflex_genlip.py182# ---------------------------------------------------------------------------------------------------------------------COMMENT
MEDIUMtests/test_eval_task.py46# ──────────────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/test_eval_task.py48# ──────────────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/test_eval_task.py105# ──────────────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/test_eval_task.py107# ──────────────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/test_data_csv.py29# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_data_csv.py31# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_data_csv.py79# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_data_csv.py81# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_task_fsdp_unit.py18# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_task_fsdp_unit.py20# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_task_fsdp_unit.py51# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_task_fsdp_unit.py53# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_task_fsdp_unit.py78# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_task_fsdp_unit.py80# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_task_fsdp_unit.py110# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_task_fsdp_unit.py112# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_task_fsdp_unit.py183# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_task_fsdp_unit.py185# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_task_fsdp_unit.py207# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_task_fsdp_unit.py209# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_modern_text.py107# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_modern_text.py109# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_modern_text.py430# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_modern_text.py432# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_modern_text.py481# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_modern_text.py483# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_modern_text.py679# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_modern_text.py681# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_task_checkpoint.py226# ──────────────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/test_task_checkpoint.py228# ──────────────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/test_task_base_unit.py61# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_task_base_unit.py63# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_task_base_unit.py107# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_task_base_unit.py109# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_task_base_unit.py150# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_task_base_unit.py152# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_task_base_unit.py215# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_task_base_unit.py217# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_task_base_unit.py225# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_task_base_unit.py227# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_task_base_unit.py249# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_task_base_unit.py251# ---------------------------------------------------------------------------COMMENT
28 more matches not shown…
Unused Imports136 hits · 110 pts
SeverityFileLineSnippetContext
LOWtests/test_legacy_data.py6CODE
LOWtests/test_legacy_data.py8CODE
LOWtests/test_grad_accum.py13CODE
LOWtests/test_factory_task.py8CODE
LOWtests/test_factory_task.py12CODE
LOWtests/test_audio_wds.py20CODE
LOWtests/test_optim_layer_decay.py8CODE
LOWtests/test_optim_layer_decay.py8CODE
LOWtests/test_task_checkpoint.py14CODE
LOWtests/test_task_checkpoint.py22CODE
LOWtests/test_naflex_mammut.py12CODE
LOWtests/test_naflex_mammut.py14CODE
LOWtests/test_training_simple.py5CODE
LOWscripts/genlip_zeroshot.py29CODE
LOWsrc/open_clip/zero_shot_classifier.py3CODE
LOWsrc/open_clip/pretrained.py7CODE
LOWsrc/open_clip/pretrained.py13CODE
LOWsrc/open_clip/hf_model.py14CODE
LOWsrc/open_clip/__init__.py1CODE
LOWsrc/open_clip/__init__.py3CODE
LOWsrc/open_clip/__init__.py4CODE
LOWsrc/open_clip/__init__.py5CODE
LOWsrc/open_clip/__init__.py6CODE
LOWsrc/open_clip/__init__.py7CODE
LOWsrc/open_clip/__init__.py7CODE
LOWsrc/open_clip/__init__.py8CODE
LOWsrc/open_clip/__init__.py8CODE
LOWsrc/open_clip/__init__.py8CODE
LOWsrc/open_clip/__init__.py8CODE
LOWsrc/open_clip/__init__.py8CODE
LOWsrc/open_clip/__init__.py8CODE
LOWsrc/open_clip/__init__.py16CODE
LOWsrc/open_clip/__init__.py16CODE
LOWsrc/open_clip/__init__.py16CODE
LOWsrc/open_clip/__init__.py16CODE
LOWsrc/open_clip/__init__.py17CODE
LOWsrc/open_clip/__init__.py17CODE
LOWsrc/open_clip/__init__.py17CODE
LOWsrc/open_clip/__init__.py17CODE
LOWsrc/open_clip/__init__.py18CODE
LOWsrc/open_clip/__init__.py18CODE
LOWsrc/open_clip/__init__.py18CODE
LOWsrc/open_clip/__init__.py18CODE
LOWsrc/open_clip/__init__.py18CODE
LOWsrc/open_clip/__init__.py18CODE
LOWsrc/open_clip/__init__.py18CODE
LOWsrc/open_clip/__init__.py18CODE
LOWsrc/open_clip/__init__.py18CODE
LOWsrc/open_clip/__init__.py29CODE
LOWsrc/open_clip/__init__.py30CODE
LOWsrc/open_clip/__init__.py30CODE
LOWsrc/open_clip/__init__.py30CODE
LOWsrc/open_clip/__init__.py30CODE
LOWsrc/open_clip/__init__.py30CODE
LOWsrc/open_clip/__init__.py30CODE
LOWsrc/open_clip/__init__.py30CODE
LOWsrc/open_clip/__init__.py30CODE
LOWsrc/open_clip/__init__.py30CODE
LOWsrc/open_clip/__init__.py30CODE
LOWsrc/open_clip/__init__.py30CODE
76 more matches not shown…
Deep Nesting49 hits · 46 pts
SeverityFileLineSnippetContext
LOWscripts/genlip_caption_stats.py51CODE
LOWscripts/genlip_caption_stats.py90CODE
LOWsrc/open_clip/zero_shot_classifier.py76CODE
LOWsrc/open_clip/pretrained.py818CODE
LOWsrc/open_clip/hf_model.py109CODE
LOWsrc/open_clip/hf_model.py263CODE
LOWsrc/open_clip/convert.py13CODE
LOWsrc/open_clip/convert.py21CODE
LOWsrc/open_clip/push_to_hf_hub.py209CODE
LOWsrc/open_clip/factory.py93CODE
LOWsrc/open_clip/factory.py322CODE
LOWsrc/open_clip/factory.py833CODE
LOWsrc/open_clip/factory.py1027CODE
LOWsrc/open_clip/factory.py1092CODE
LOWsrc/open_clip/model.py457CODE
LOWsrc/open_clip/tokenizer.py100CODE
LOWsrc/open_clip/tokenizer.py436CODE
LOWsrc/open_clip/tokenizer.py528CODE
LOWsrc/open_clip/tokenizer.py807CODE
LOWsrc/open_clip/loss.py434CODE
LOWsrc/open_clip/utils.py67CODE
LOWsrc/open_clip/transformer.py959CODE
LOWsrc/open_clip/transformer.py158CODE
LOWsrc/open_clip/transform.py367CODE
LOWsrc/open_clip/naflex_genlip_model.py595CODE
LOWsrc/open_clip/naflex_genlip_model.py597CODE
LOWsrc/open_clip/audio/convert.py76CODE
LOWsrc/open_clip/audio/whisper.py379CODE
LOWsrc/open_clip/audio/htsat.py1158CODE
LOWsrc/open_clip/audio/htsat.py104CODE
LOWsrc/open_clip/audio/htsat.py741CODE
LOWsrc/open_clip/audio/htsat.py1032CODE
LOWsrc/open_clip/audio/transform.py94CODE
LOWsrc/open_clip/task/base_task.py400CODE
LOWsrc/open_clip_train/legacy_train.py80CODE
LOWsrc/open_clip_train/legacy_train.py268CODE
LOWsrc/open_clip_train/legacy_main.py71CODE
LOWsrc/open_clip_train/distributed.py23CODE
LOWsrc/open_clip_train/naflex_data.py917CODE
LOWsrc/open_clip_train/audio_zero_shot.py299CODE
LOWsrc/open_clip_train/train.py222CODE
LOWsrc/open_clip_train/train.py343CODE
LOWsrc/open_clip_train/train.py542CODE
LOWsrc/open_clip_train/zero_shot.py54CODE
LOWsrc/open_clip_train/main.py97CODE
LOWsrc/open_clip_train/profiler.py131CODE
LOWsrc/open_clip_train/optim.py78CODE
LOWsrc/open_clip_train/data.py746CODE
LOWsrc/open_clip_train/data.py1192CODE
AI Structural Patterns36 hits · 34 pts
SeverityFileLineSnippetContext
LOWtests/util_test.py141CODE
LOWsrc/open_clip/coca_model.py167CODE
LOWsrc/open_clip/coca_model.py310CODE
LOWsrc/open_clip/generation.py380CODE
LOWsrc/open_clip/push_to_hf_hub.py156CODE
LOWsrc/open_clip/modified_resnet.py56CODE
LOWsrc/open_clip/mammut_model.py256CODE
LOWsrc/open_clip/factory.py322CODE
LOWsrc/open_clip/factory.py1205CODE
LOWsrc/open_clip/factory.py1341CODE
LOWsrc/open_clip/model.py457CODE
LOWsrc/open_clip/model.py657CODE
LOWsrc/open_clip/transformer.py63CODE
LOWsrc/open_clip/transformer.py272CODE
LOWsrc/open_clip/transformer.py338CODE
LOWsrc/open_clip/transformer.py481CODE
LOWsrc/open_clip/transformer.py598CODE
LOWsrc/open_clip/transformer.py1155CODE
LOWsrc/open_clip/transformer.py1236CODE
LOWsrc/open_clip/transformer.py1817CODE
LOWsrc/open_clip/transformer.py2336CODE
LOWsrc/open_clip/naflex_config.py29CODE
LOWsrc/open_clip/timm_model.py29CODE
LOWsrc/open_clip/audio/htsat.py38CODE
LOWsrc/open_clip/audio/htsat.py87CODE
LOWsrc/open_clip/audio/htsat.py104CODE
LOWsrc/open_clip/audio/htsat.py449CODE
LOWsrc/open_clip/audio/htsat.py641CODE
LOWsrc/open_clip/audio/htsat.py741CODE
LOWsrc/open_clip/task/coca_task.py20CODE
LOWsrc/open_clip/task/clip_task.py12CODE
LOWsrc/open_clip/task/clap_task.py17CODE
LOWsrc/open_clip/task/distill_task.py12CODE
LOWsrc/open_clip_train/naflex_data.py464CODE
LOWsrc/open_clip_train/naflex_data.py828CODE
LOWsrc/open_clip_train/naflex_data.py964CODE
Excessive Try-Catch Wrapping30 hits · 33 pts
SeverityFileLineSnippetContext
MEDIUMtests/test_optim_layer_decay.py451def _build_clap_htsat():CODE
LOWtests/test_optim_layer_decay.py146 except Exception as e: # offline / hub unavailableCODE
LOWtests/test_optim_layer_decay.py454 except Exception as e: # optional deps / config issuesCODE
LOWtests/test_optim_layer_decay.py518 except Exception as e: # nadamuon may be absent in older timmCODE
LOWsrc/open_clip/pretrained.py906 except Exception:CODE
LOWsrc/open_clip/pretrained.py918 except Exception as e:CODE
LOWsrc/open_clip/push_to_hf_hub.py118 except Exception as e:CODE
LOWsrc/open_clip/factory.py433 except Exception as e:CODE
LOWsrc/open_clip/factory.py457 except Exception as e_weights:CODE
LOWsrc/open_clip/factory.py460 except Exception as e_config:CODE
LOWsrc/open_clip/factory.py488 except Exception as e:CODE
LOWsrc/open_clip/factory.py668 except Exception as e:CODE
LOWsrc/open_clip/factory.py696 except Exception as e:CODE
LOWsrc/open_clip/factory.py718 except Exception as e:CODE
LOWsrc/open_clip/factory.py872 except Exception as e:CODE
LOWsrc/open_clip/factory.py888 except Exception as e:CODE
LOWsrc/open_clip/tokenizer.py202 except Exception:CODE
LOWsrc/open_clip/timm_model.py181 except Exception as e:CODE
LOWsrc/open_clip/audio/whisper.py430 except Exception as e:CODE
LOWsrc/open_clip/audio/htsat.py1205 except Exception as exc:STRING
MEDIUMsrc/open_clip/audio/htsat.py1158def create_htsat_model(audio_cfg, enable_fusion=False, fusion_type="None"):CODE
LOWsrc/open_clip_train/naflex_data.py303 except Exception:CODE
LOWsrc/open_clip_train/naflex_data.py763 except Exception as ex:CODE
LOWsrc/open_clip_train/file_utils.py40 except Exception as e:CODE
LOWsrc/open_clip_train/profiler.py229 except Exception as e:CODE
MEDIUMsrc/open_clip_train/profiler.py230 print(f'Error profiling {m}: {e}')CODE
LOWsrc/open_clip_train/optim.py117 except Exception: # a submodule's hook may assume context we don't have; skip it rather than failCODE
LOWsrc/open_clip_train/optim.py124 except Exception:CODE
LOWsrc/open_clip_train/optim.py131 except Exception:CODE
LOWsrc/open_clip_train/data.py81 except Exception as exn:CODE
Modern AI Meta-Vocabulary7 hits · 20 pts
SeverityFileLineSnippetContext
MEDIUMREADME.md71| Model | Training data | Resolution | # of samples seen | ImageNet zero-shot acc. |CODE
MEDIUMREADME.md532### Evaluating hosted pretrained checkpoint on ImageNet zero-shot prediction:COMMENT
MEDIUMREADME.md541### Evaluating CLAP audio models on zero-shot audio classification:COMMENT
MEDIUMtests/test_eval_task.py37 zeroshot_frequency=0, # disable zero-shot to keep test fastCODE
MEDIUMsrc/open_clip/audio/config.py31 # Eval-time audio-token CAP for NaFlexClap zero-shot (mirror of vision_cfg.image_seq_len). Audio isCOMMENT
MEDIUMsrc/open_clip/task/checkpoint.py186 # Build empty DTensor scaffolding, then let DCP fill itCOMMENT
MEDIUMsrc/open_clip_train/zero_shot.py136 # tower (generative VLMs such as GenLIP): the text-classifier zero-shot path requires encode_text.COMMENT
Docstring Block Structure3 hits · 15 pts
SeverityFileLineSnippetContext
HIGHsrc/open_clip/factory.py151 Parses a model name string to identify a schema and the remaining identifier. Args: model_name: The moSTRING
HIGHsrc/open_clip/factory.py1361 Creates a contrastive vision-language model from pretrained weights with optional preprocessing transform. ThiSTRING
HIGHsrc/open_clip_train/optim.py257Build optimizer param groups with layer-wise LR decay applied to the text / image / audio tower(s). Each decayed toSTRING
Cross-File Repetition3 hits · 15 pts
SeverityFileLineSnippetContext
HIGHsrc/open_clip/modified_resnet.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if int, all if noneSTRING
HIGHsrc/open_clip/transformer.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if int, all if noneSTRING
HIGHsrc/open_clip/timm_model.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if int, all if noneSTRING
AI Slop Vocabulary4 hits · 14 pts
SeverityFileLineSnippetContext
MEDIUMtests/test_optim_layer_decay.py374# ---- robust weight-decay exclusion filter ----COMMENT
MEDIUMsrc/open_clip/factory.py739 # Absolutely no weights were loaded from any sourceCOMMENT
MEDIUMsrc/open_clip/tokenizer.py536 # adding lower (for case-sensitive tokenizers) will make it more robust but less sensitive to nuanceCOMMENT
MEDIUMsrc/open_clip/tokenizer.py720 # adding lower (for case-sensitive tokenizers) will make it more robust but less sensitive to nuanceCOMMENT
Redundant / Tautological Comments8 hits · 12 pts
SeverityFileLineSnippetContext
LOWsrc/open_clip/push_to_hf_hub.py111 # Check if repo already exists and determine what needs updatingCOMMENT
LOWsrc/open_clip/factory.py235 # Check if safetensors or not and load weights accordinglyCOMMENT
LOWsrc/open_clip/factory.py418 # Check if the required 'model_cfg' key is presentCOMMENT
LOWsrc/open_clip/factory.py480 # Check if `pretrained` is a known tagCOMMENT
LOWsrc/open_clip/factory.py657 # Check if model has the 'visual' attributeCOMMENT
LOWsrc/open_clip/factory.py902 # Check if config determination failed completely (should only be possible if initial schema parsing failed badly)COMMENT
LOWsrc/open_clip/timm_model.py246 # Check if the underlying timm model has set_input_size methodCOMMENT
LOWsrc/open_clip_train/distributed.py134 # Check if init_process_group supports device_id (added in PyTorch ~2.4).COMMENT
Over-Commented Block7 hits · 7 pts
SeverityFileLineSnippetContext
LOWsrc/open_clip/pos_embed.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOWsrc/open_clip/tokenizer.py461 cache_dir: Optional[str] = None,COMMENT
LOWsrc/open_clip/tokenizer.py481 # if tokenizer_name.startswith('hf-hub:'):COMMENT
LOWsrc/open_clip/transformer.py781 # nn.init.normal_(self.positional_embedding, std=self.scale)COMMENT
LOWsrc/open_clip/transformer.py1581 # cannot initially key onto, growing only as needed.COMMENT
LOWsrc/open_clip/audio/htsat.py1121 # output_dict = self.forward_features(x)COMMENT
LOWsrc/open_clip/audio/htsat.py1141 # framewise_output += d["framewise_output"]COMMENT
Cross-Language Confusion1 hit · 5 pts
SeverityFileLineSnippetContext
HIGHscripts/genlip_zeroshot.py212 scores = scores - uncond # PMI: log P(cap|img) - log P(cap|null)CODE
Self-Referential Comments1 hit · 3 pts
SeverityFileLineSnippetContext
MEDIUMsrc/open_clip_train/data.py183 # Create the shared counter in the SAME multiprocessing context as the DataLoader workers. A fork-contextCOMMENT
Modern Structural Boilerplate2 hits · 2 pts
SeverityFileLineSnippetContext
LOWsrc/open_clip/audio/__init__.py30__all__ = [CODE
LOWsrc/open_clip_train/naflex_data.py31__all__ = [CODE