Skip to content

Instantly share code, notes, and snippets.

View bench87's full-sized avatar

최명규 bench87

View GitHub Profile
@bench87
bench87 / bert-multi-label.py
Created November 11, 2024 13:17
bert-base multi label
from datetime import datetime
from torch.utils.tensorboard import SummaryWriter
from datasets import load_dataset
from transformers import AutoTokenizer, AutoModelForSequenceClassification, TrainingArguments, Trainer
import numpy as np
import torch
from sklearn.metrics import f1_score, roc_auc_score, accuracy_score
from transformers import EvalPrediction
# Load dataset
@bench87
bench87 / scalaMetaprogramming.scala
Created September 22, 2024 07:55
Inline your boilerplate – harnessing Scala 3 metaprogramming without macros
//> using scala "3"
import scala.compiletime.{erasedValue, summonInline, constValue, error}
import scala.deriving.Mirror
import scala.collection.Factory
import scala.annotation.implicitNotFound
import scala.util.NotGiven
import Field.TypeForLabel
infix type =:!=[A, B] = NotGiven[A =:= B]