Skip to content

Instantly share code, notes, and snippets.

View esnya's full-sized avatar

esnya

  • Japan
View GitHub Profile
@hollance
hollance / alignment-heads.md
Last active September 6, 2024 10:27
Alignment heads for Whisper word-level timestamps with Hugging Face Transformers

To allow the Hugging Face version of Whisper to predict word-level timestamps, a new property alignment_heads must be added to the GenerationConfig object. This is a list of [layer, head] pairs that select the cross-attention heads that are highly correlated to word-level timing.

If your Whisper checkpoint does not have the alignment_heads property yet, it can be added in two possible ways.

Method 1. Change the model.generation_config property:

# load the model
model = WhisperForConditionalGeneration.from_pretrained("your_checkpoint")
@phi16
phi16 / Air.shader
Created August 1, 2020 07:36
original
Shader "Amebient/Air"
{
Properties
{
_Color ("Color", Color) = (0.5,0.8,1,1)
}
SubShader
{
Tags { "RenderType"="Transparent" "Queue"="Transparent-525" "LightMode"="ForwardBase" "DisableBatching"="True" }
LOD 100