Repository 指南 · 原始碼導讀 · v2
openai / whisper · 原始碼導讀
這份導讀依據對版本 86098128c0b4f24f0e2aa2994de830614b474227 的靜態分析,帶開發者走過 openai/whisper。內容詳述檔案定位、進入點的執行流程、核心函式庫模組,以及靜態耦合點。
- 原始 repository
- openai/whisper
- 授權
- MIT · 開源授權
- 分析的版本 · 最後驗證
- 86098128c0b4f24f0e2aa2994de830614b474227 ·
本頁中文由負責的 AI 編輯依英文正式版本 v2 翻譯;程式碼名稱、路徑、行號與數字都經確定性檢查,與英文版一致。陳述與依據表保留英文原文,因為那是獨立驗證者核對過的紀錄。看英文原文
openai/whisper:原始碼導讀
本頁用語說明
- Entrypoint record(進入點記錄)
- 分析器標記為「程式可能從這裡開始執行」的檔案。附有 __main__ guard 摘錄時,表示檔案裡有 if __name__ == "__main__": 區塊,摘錄顯示它呼叫了什麼;沒有摘錄時,只是依檔名判斷。
- Bounded static execution path(有界靜態執行路徑)
- 不執行程式、直接從原始碼重建出的呼叫鏈,走到固定步數就停。它說明在紙面上能追到多遠,不代表實際執行時會發生什麼。
- Unresolved boundary(未解析邊界)
- 靜態路徑停下的地方:下一個呼叫進入外部函式庫,或不執行就無法確定。這是本次分析的邊界,不是 repository 的缺陷。
- Static relations(靜態關係)
- 在原始碼中找到的呼叫與 import。「external or unresolved」表示指向分析範圍以外。
- Module role(模組角色)
- 分析器依呼叫進出次數推論的檔案標籤(例如 core、entry/orchestration、leaf)。它描述的是在呼叫圖中的位置,不是作者的設計意圖。
- Test-like files(類測試檔案)
- 名稱或位置看起來像測試的檔案。本次分析只計數,不執行。
- Observed · inferred · author-claimed · unresolved
- 每句話的依據:直接讀自分析的檔案;由分析器從檔案推論;repository 作者自述(metadata、README);或本次分析無法確定。
- Verified(已驗證)
- 本頁有兩種用法。在分析器的記錄裡(「verified provenance」「verified entrypoint」),它表示這筆記錄是直接從分析的檔案讀到的,也就是本指南所說的 observed;以進入點來說,就是檔案裡確實有 __main__ guard 的文字。分析器在 2026-10-04 修正後,只有 cli.py、main.py 這類像進入點的檔名、沒有 guard 的檔案,會記為 inferred(推測);在那之前分析的指南仍把這類檔案標成 verified,它依然只是對檔案用途的推測。它不代表程式被執行或測試過。「最後驗證」是這份指南最後一次通過本實驗室檢查的日期,檢查對象是所標示版本的分析記錄,不是對 repository 本身的審查。
怎麼使用這份導讀
這份導讀勾勒出一條依序檢視被分析版本 86098128c0b4f24f0e2aa2994de830614b474227 的閱讀順序。指南裡引用的每一個行號範圍,都嚴格指向那個版本的檔案。分析器把檔案切成可依行定位的語意程式碼區塊,當作參照的單位。每一段區塊描述、角色和摘要,反映的都是分析器的靜態推論,而不是執行時的證明。
第 1 站:定位
從分析器定位課程找出的主要檔案容器開始讀:
whisper/transcribe.py:1-623:modulewhisper/transcribe.py。這個檔案層級的區塊代表被分析的原始碼檔案 whisper/transcribe.py,並為它的程式碼提供檔案層級的容器。
第 2 站:執行的故事
從 whisper/transcribe.py 裡偵測到的主要進入點開始追蹤執行。分析器的十二條有界執行路徑中,有五條從這個守衛出發,先走到 cli,再碰上 argparse 呼叫這類未解析的函式庫邊界。
whisper/transcribe.py:622-623:main_guard__main__。這個區塊是直接執行守衛,控制在直接執行(而不是被 import)時才會跑的程式碼。whisper/transcribe.py:517-619:functioncli。類函式區塊,封裝一個操作,連到 68 條下游呼叫或 import 關係。
第 3 站:核心程式碼
分析器核心程式碼課程的 8 個區塊中,只有 2 個位在函式庫程式碼裡,其餘 6 個區塊都在測試檔案中(tests/conftest.py:7-8、tests/conftest.py:12-14、tests/test_audio.py:8-19、tests/test_normalizer.py:11-82、tests/test_normalizer.py:85-89 和 tests/test_normalizer.py:92-104)。為了檢視核心功能,AI Frontier 實驗室依靜態呼叫次數,確定性地挑出四個相連的模組。
whisper/model.py 是 service/core 候選,有 22 個呼入和 20 個呼出:
whisper/model.py:259-352:classWhisper。把相關的行為歸在同一個類別邊界裡。whisper/model.py:81-146:classMultiHeadAttention。把相關的行為歸在同一個類別邊界裡。
whisper/timing.py 是 service/core 候選,有 16 個呼入和 9 個呼出:
whisper/timing.py:279-388:functionadd_word_timestamps。連到 30 條下游呼叫或 import 關係。whisper/timing.py:163-242:functionfind_alignment。連到 37 條下游呼叫或 import 關係。
whisper/decoding.py 是 service/core 候選,有 11 個呼入和 13 個呼出:
whisper/decoding.py:508-789:classDecodingTask。把相關的行為歸在同一個類別邊界裡。whisper/decoding.py:301-404:classBeamSearchDecoder。把相關的行為歸在同一個類別邊界裡。
whisper/transcribe.py 是 entry/orchestration 候選,有 3 個呼入和 18 個呼出:
whisper/transcribe.py:38-514:functiontranscribe。連到 99 條下游呼叫或 import 關係。whisper/transcribe.py:517-619:functioncli。連到 68 條下游呼叫或 import 關係。
第 4 站:修改會波及哪裡
修改程式時,請優先留意這些靜態圖耦合最強的區塊。耦合訊號同時出現在函式庫操作和測試斷言上:
whisper/transcribe.py:38-514:functiontranscribe。連到 99 條下游呼叫或 import 關係。whisper/normalizers/english.py:165-386:functionEnglishNumberNormalizer.process_words。連到 94 條下游呼叫或 import 關係。whisper/normalizers/english.py:188-383:EnglishNumberNormalizer.process_words裡的 for 迴圈。依迴圈條件重複執行一段原始碼區域。whisper/transcribe.py:517-619:functioncli。連到 68 條下游呼叫或 import 關係。whisper/transcribe.py:264-508:transcribe裡的 with 情境管理區塊。在情境管理器之下限定操作的範圍。tests/test_normalizer.py:11-82:functiontest_number_normalizer。測試函式,連到 58 條下游呼叫或 import 關係。
這份導讀看不到的東西
這份導讀只反映靜態分析。反射、動態 import、monkey-patching 和框架在執行期的接線這類執行期特性都沒有解析。關於安裝、建置或執行的推論仍不完整,安裝指令也沒有驗證。區塊註解是附帶信心值的推論,靜態圖中仍有 1233 條靜態關係沒有解析。
這次分析無法確定的事
這些是撰寫模型對分析記錄自己的說明。lim_3、exec_* 或 claim_… 這類識別碼指的是那次分析裡的記錄;陳述與依據表引用的也是同一批記錄。
- 有 1233 條靜態關係仍是外部或未解析。
陳述與依據 — 40 條陳述,40 條經獨立驗證者確認(英文原文)
Every substantive statement above is a claim bound to grounding IDs of the analyzed revision. Global grounding IDs are namespaced by the analysis run.
| Claim | Epistemic status | Verifier | Grounding (global IDs) |
|---|---|---|---|
| c1 The walkthrough provides a reading order for the analyzed revision 86098128c0b4f24f0e2aa2994de830614b474227. | inferred | supported | analysis_ee52b965e66bce7b:summary_repository |
| c2 The analyzed repository is openai/whisper. | inferred | supported | analysis_ee52b965e66bce7b:summary_repository |
| c3 The walkthrough covers file orientation, entrypoint flows, library modules, and coupling points. | inferred | supported | analysis_ee52b965e66bce7b:summary_repository, analysis_ee52b965e66bce7b:role_10, analysis_ee52b965e66bce7b:role_14, analysis_ee52b965e66bce7b:role_9, analysis_ee52b965e66bce7b:role_16, analysis_ee52b965e66bce7b:block_96c561f634541f, analysis_ee52b965e66bce7b:block_c3b92412d2b462, analysis_ee52b965e66bce7b:block_e4a22c3680df88, analysis_ee52b965e66bce7b:block_d935652e3f7f0f, analysis_ee52b965e66bce7b:block_f02ce3a6bfb8de, analysis_ee52b965e66bce7b:block_d090cdefd1be4d, analysis_ee52b965e66bce7b:block_336e1318f6d98f, analysis_ee52b965e66bce7b:block_b58d73fc8283d0 |
| c4 Line ranges cited in the walkthrough refer directly to files in the analyzed revision. | inferred | supported | analysis_ee52b965e66bce7b:summary_repository |
| c5 A block is the analyzer's line-addressable semantic code unit. | inferred | supported | analysis_ee52b965e66bce7b:summary_repository |
| c6 Block descriptions are the analyzer's inferences. | inferred | supported | analysis_ee52b965e66bce7b:summary_repository |
| c7 whisper/transcribe.py contains module block 1-623. | inferred | supported | analysis_ee52b965e66bce7b:block_96c561f634541f |
| c8 The analyzer summary identifies whisper/transcribe.py lines 1-623 as the source file container. | inferred | supported | analysis_ee52b965e66bce7b:block_96c561f634541f |
| c9 The verified entrypoint guard is in whisper/transcribe.py. | observed | supported | analysis_ee52b965e66bce7b:py_entry_e9d8e13fe4d4 |
| c10 Bounded execution path exec_210328c6174a originates at whisper/transcribe.py:__main__ and ends at an unresolved boundary. | inferred | supported | analysis_ee52b965e66bce7b:exec_210328c6174a |
| c11 Bounded execution path exec_873b5bbd14cf steps from whisper/transcribe.py:cli to parser.add_argument. | inferred | supported | analysis_ee52b965e66bce7b:exec_873b5bbd14cf |
| c12 whisper/transcribe.py contains main guard block 622-623. | inferred | supported | analysis_ee52b965e66bce7b:block_c3b92412d2b462 |
| c13 Block 622-623 gates direct execution of whisper/transcribe.py. | inferred | supported | analysis_ee52b965e66bce7b:block_c3b92412d2b462 |
| c14 Function cli exists at whisper/transcribe.py:517-619. | observed | supported | analysis_ee52b965e66bce7b:py_func_a31ce0a9065c |
| c15 Block 517-619 connects to 68 downstream relations. | inferred | supported | analysis_ee52b965e66bce7b:block_e4a22c3680df88 |
| c16 2 of the core-code lesson's 8 blocks lie in library code. | inferred | supported | analysis_ee52b965e66bce7b:block_c3b92412d2b462, analysis_ee52b965e66bce7b:block_e4a22c3680df88, analysis_ee52b965e66bce7b:block_e344a91bc2d2b1, analysis_ee52b965e66bce7b:block_fa551a470878d6, analysis_ee52b965e66bce7b:block_2239b47a6a10eb, analysis_ee52b965e66bce7b:block_b58d73fc8283d0, analysis_ee52b965e66bce7b:block_6fe11ede9d4668, analysis_ee52b965e66bce7b:block_95faf61a114114 |
| c17 The library reading set was selected deterministically by the AI Frontier lab from static call degree. | inferred | supported | analysis_ee52b965e66bce7b:role_10, analysis_ee52b965e66bce7b:role_14, analysis_ee52b965e66bce7b:role_9, analysis_ee52b965e66bce7b:role_16 |
| c18 whisper/model.py is categorized with 22 incoming and 20 outgoing calls under role_10. | inferred | supported | analysis_ee52b965e66bce7b:role_10 |
| c19 Class Whisper exists at whisper/model.py:259-352. | observed | supported | analysis_ee52b965e66bce7b:py_class_258632aeaf38 |
| c20 Block 259-352 groups Whisper behavior. | inferred | supported | analysis_ee52b965e66bce7b:block_2045a12cd91254 |
| c21 Class MultiHeadAttention exists at whisper/model.py:81-146. | observed | supported | analysis_ee52b965e66bce7b:py_class_4ed9b8eada83 |
| c22 Block 81-146 groups MultiHeadAttention behavior. | inferred | supported | analysis_ee52b965e66bce7b:block_eae7300e43f5c6 |
| c23 whisper/timing.py has 16 incoming and 9 outgoing calls under role_14. | inferred | supported | analysis_ee52b965e66bce7b:role_14 |
| c24 Function add_word_timestamps exists at whisper/timing.py:279-388. | observed | supported | analysis_ee52b965e66bce7b:py_func_69d75b442d80 |
| c25 Block 279-388 connects to 30 downstream relations. | inferred | supported | analysis_ee52b965e66bce7b:block_99968fd1a96cde |
| c26 Function find_alignment exists at whisper/timing.py:163-242. | observed | supported | analysis_ee52b965e66bce7b:py_func_e1372f4b817b |
| c27 Block 163-242 connects to 37 downstream relations. | inferred | supported | analysis_ee52b965e66bce7b:block_7235f1f3ee66a3 |
| c28 whisper/decoding.py has 11 incoming and 13 outgoing calls under role_9. | inferred | supported | analysis_ee52b965e66bce7b:role_9 |
| c29 Class DecodingTask exists at whisper/decoding.py:508-789. | observed | supported | analysis_ee52b965e66bce7b:py_class_92c2e830586f |
| c30 Class BeamSearchDecoder exists at whisper/decoding.py:301-404. | observed | supported | analysis_ee52b965e66bce7b:py_class_61d8ff25d720 |
| c31 whisper/transcribe.py has 3 incoming and 18 outgoing calls under role_16. | inferred | supported | analysis_ee52b965e66bce7b:role_16 |
| c32 whisper/transcribe.py function transcribe at lines 38-514 connects to 99 downstream relations. | inferred | supported | analysis_ee52b965e66bce7b:block_d935652e3f7f0f |
| c33 EnglishNumberNormalizer.process_words spans lines 165-386 with 94 downstream relations. | inferred | supported | analysis_ee52b965e66bce7b:block_f02ce3a6bfb8de |
| c34 Loop block 188-383 in whisper/normalizers/english.py controls flow inside EnglishNumberNormalizer.process_words. | inferred | supported | analysis_ee52b965e66bce7b:block_d090cdefd1be4d |
| c35 Context manager block lines 264-508 in whisper/transcribe.py scopes operations in transcribe. | inferred | supported | analysis_ee52b965e66bce7b:block_336e1318f6d98f |
| c36 Test function test_number_normalizer spans lines 11-82 in tests/test_normalizer.py with 58 relations. | inferred | supported | analysis_ee52b965e66bce7b:block_b58d73fc8283d0 |
| c37 The analysis is static only and cannot resolve dynamic imports, reflection, or framework runtime wiring. | observed | supported | analysis_ee52b965e66bce7b:lim_1 |
| c38 Installation commands are not verified and install/run inference is partial. | observed | supported | analysis_ee52b965e66bce7b:lim_2 |
| c39 Block annotations carry analyzer confidences rather than runtime guarantees. | inferred | supported | analysis_ee52b965e66bce7b:block_96c561f634541f, analysis_ee52b965e66bce7b:block_c3b92412d2b462 |
| c40 1233 static relations remain external or unresolved in the analyzed codebase. | inferred | supported | analysis_ee52b965e66bce7b:summary_repository |
來源、權利與說明 · attribution-license-templates/v0.1
權利聲明。原始 repository 託管於 GitHub。其原始碼、文件、名稱、媒體與相關素材的權利,仍屬各自的作者、貢獻者與其他權利人所有,並受該 repository 的授權條款約束。
Original repository hosted on GitHub. Repository source code, documentation, names, media, and related project materials remain subject to the rights of their respective authors, contributors, and other rights holders and to applicable repository license terms.
平台聲明。GitHub 是所連結 repository 的來源託管平台。GitHub 與相關標誌為 GitHub, Inc. 的商標。除非另有明確說明,EVEMISS Technology 與 GitHub 之間沒有隸屬或背書關係。
GitHub is the source hosting platform for the linked repository. GitHub and related marks are trademarks of GitHub, Inc. EVEMISS Technology is not affiliated with or endorsed by GitHub unless explicitly stated otherwise.
這一頁怎麼來的。本頁由對應版本的 repository 分析與 AI 輔助的編輯工具產生。技術陳述綁定所分析的版本;原始 repository 更新後,可能重新驗證。
This page was produced using revision-aware repository analysis and AI-assisted editorial tooling. Technical claims are tied to the analyzed repository revision and may be revalidated when the source repository changes.
本頁包含 AI 輔助分析,並經 EVEMISS Technology 人工與 AI 協力審閱。 · 回報權利疑慮 · 回到概覽