|
|
|
from transformers import AutoTokenizer, AutoModelForSequenceClassification |
|
|
|
tokenizer = AutoTokenizer.from_pretrained("snunlp/KR-FinBert-SC") |
|
model = AutoModelForSequenceClassification.from_pretrained("snunlp/KR-FinBert-SC") |
|
|
|
import os |
|
import tensorflow as tf |
|
from absl import logging |
|
|
|
|
|
os.environ['TF_ENABLE_ONEDNN_OPTS'] = '0' |
|
|
|
|
|
logging.set_verbosity(logging.INFO) |
|
logging.use_absl_handler() |
|
|
|
|
|
gpus = tf.config.experimental.list_physical_devices('GPU') |
|
if gpus: |
|
try: |
|
for gpu in gpus: |
|
tf.config.experimental.set_memory_growth(gpu, True) |
|
print("GPU λ©λͺ¨λ¦¬ μ¦κ° νμ© μ€μ μλ£") |
|
except RuntimeError as e: |
|
print(f"GPU μ€μ μ€λ₯: {e}") |
|
|
|
|
|
print("TensorFlow λ²μ :", tf.__version__) |
|
print("μ¬μ© κ°λ₯ν μ₯μΉ:", tf.config.list_physical_devices()) |
|
|