Skip to content

Instantly share code, notes, and snippets.

View honglu2875's full-sized avatar

Honglu Fan honglu2875

View GitHub Profile
@honglu2875
honglu2875 / sample_interpolate.py
Last active October 31, 2023 09:52
Aria scripts
"""Contains generation/sampling code"""
# This file contains code from https://github.com/facebookresearch/llama which
# is available under the following licence:
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the GNU
# General Public License version 3.
import torch
@honglu2875
honglu2875 / Evaluate Classifier-Free Guidance impact
Last active June 12, 2023 18:12
The scripts used in HumanEval evaluation with CFG
_
import torch
from torch import nn
import time
bias = torch.tril(torch.ones((2048, 2048), dtype=torch.uint8, device='cuda')).view(
1, 1, 2048, 2048
)
def _attn(
query,
key,