This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bert_squeeze.assistants import DistilAssistant | |
from lightning.pytorch import Trainer | |
config_assistant = { | |
"teacher_kwargs": { | |
"pretrained_model": "cnicu/t5-small-booksum", | |
}, | |
"student_kwargs": { | |
"pretrained_model": "cnicu/t5-small-booksum", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from transformers import GPT2Tokenizer, AutoModelForVision2Seq | |
import requests | |
model_name = "mozilla/distilvit" | |
def load_words_from_url(url): | |
response = requests.get(url) | |
response.raise_for_status() | |
words = {line.strip() for line in response.text.splitlines()} | |
return words |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import onnx | |
from onnx import helper | |
new_name = "FirefoxMatMulInteger8" | |
def replace_matmul_with_firefoxmatmul(onnx_file_path, output_file_path): | |
# Load the ONNX model | |
model = onnx.load(onnx_file_path) |
OlderNewer