Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions modeling/bagel/qwen2_navit.py
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ def forward_inference(

enable_taylorseer = getattr(self, 'enable_taylorseer', False)

if enable_taylorseer and self.current['type'] == 'full':
if enable_taylorseer and self.current['type'] == 'full' and self.current['layer'] == 27:
self.current['module'] = 'total'
taylor_cache_init(cache_dic=self.cache_dic, current=self.current)

Expand Down Expand Up @@ -821,7 +821,7 @@ def forward_inference(

packed_query_sequence = residual + packed_query_sequence

if enable_taylorseer:
if enable_taylorseer and self.current['layer'] == 27:
if self.current['type'] == 'full':
derivative_approximation(cache_dic=self.cache_dic, current=self.current, feature=packed_query_sequence)
elif self.current['type'] == 'Taylor':
Expand Down