Yuchan commited on
Update Model.py
Browse files102 unmodified lines10310410510610710810919 unmodified lines129130131132133134135102 unmodified lines# Dataset 생성 (예: 처음 10,000라인만)dataset = tf.data.Dataset.from_generator(lambda: txt_stream(DATA_PATH, num_lines=10000),output_signature=(tf.TensorSpec(shape=(max_len,), dtype=tf.int32),tf.TensorSpec(shape=(max_len,), dtype=tf.int32),19 unmodified linesreturn tf.cast(out, x.dtype)class SparseCausalAttention(tf.keras.layers.Layer):def __init__(self, num_heads, head_dim, window_size=16, **kwargs):super().__init__(**kwargs)self.num_heads = num_headsself.head_dim = head_dim102 unmodified lines10310410510610710810919 unmodified lines129130131132133134135102 unmodified lines# Dataset 생성 (예: 처음 10,000라인만)dataset = tf.data.Dataset.from_generator(lambda: txt_stream(DATA_PATH, num_lines=100000),output_signature=(tf.TensorSpec(shape=(max_len,), dtype=tf.int32),tf.TensorSpec(shape=(max_len,), dtype=tf.int32),19 unmodified linesreturn tf.cast(out, x.dtype)class SparseCausalAttention(tf.keras.layers.Layer):def __init__(self, num_heads, head_dim, window_size=8, **kwargs):super().__init__(**kwargs)self.num_heads = num_headsself.head_dim = head_dim
Model.py+2-2