Skip to content

Instantly share code, notes, and snippets.

@RyanKor
Created December 6, 2021 01:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RyanKor/515e56808f355400252177612441dbef to your computer and use it in GitHub Desktop.
Save RyanKor/515e56808f355400252177612441dbef to your computer and use it in GitHub Desktop.
wanted_env
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import platform
%matplotlib inline
import matplotlib
import tensorflow as tf
BATCH_SIZE=6 # 커널이 계속 죽는다.. (메모리 초과...;) -> 배치 사이즈가 6보다 크면 메모리 초과 발생;
MAX_SEQ_LEN = 512
import os # GPU 설정
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID";
os.environ["CUDA_VISIBLE_DEVICES"]="0";
import warnings # warning message ignore
warnings.filterwarnings(action='ignore')
# install transformers
# !pip install transformers
import transformers
# model import
from transformers import DistilBertConfig, TFDistilBertForSequenceClassification, DistilBertTokenizer
from sklearn.model_selection import train_test_split
# 한글 폰트 설정
if platform.system() == 'Darwin': # mac
plt.rc('font', family='AppleGothic')
else: # window or linux
plt.rc('font', family='NanumGothicCoding')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment