Skip to content

Instantly share code, notes, and snippets.

@titu1994
Last active May 22, 2024 20:22
Show Gist options
  • Save titu1994/89649c8d628b58f2537d1e67082593b6 to your computer and use it in GitHub Desktop.
Save titu1994/89649c8d628b58f2537d1e67082593b6 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@RomanLeo2003
Copy link

Why that part:
decoding_cfg = model.cfg.decoding decoding_cfg.preserve_alignments = True # Preserve alignment information using models logits decoding_cfg.compute_timestamps = True # Compute greedy word timestamps

Throws:

`ConfigAttributeError Traceback (most recent call last)
in <cell line: 2>()
1 decoding_cfg = model.cfg.decoding
----> 2 decoding_cfg.preserve_alignments = True # Preserve alignment information using models logits
3 decoding_cfg.compute_timestamps = True # Compute greedy word timestamps
4
5 print("Current decoder type:", model.cur_decoder)

9 frames
/usr/local/lib/python3.10/dist-packages/omegaconf/_utils.py in _raise(ex, cause)
795 else:
796 ex.cause = None
--> 797 raise ex.with_traceback(sys.exc_info()[2]) # set env var OC_CAUSE=1 for full trace
798
799

ConfigAttributeError: Key 'preserve_alignments' is not in struct
full_key: decoding.preserve_alignments
object_type=dict`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment