File size: 954 Bytes
164e64f
 
 
 
72664d1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Load model directly
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'  # oneDNN ์ตœ์ ํ™” ๋น„ํ™œ์„ฑํ™”

# ๋กœ๊ทธ ์ดˆ๊ธฐํ™”
logging.set_verbosity(logging.INFO)
logging.use_absl_handler()

# GPU ์„ค์ •
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}")

# TensorFlow ๋ฐ ์‹œ์Šคํ…œ ์ •๋ณด ํ™•์ธ
print("TensorFlow ๋ฒ„์ „:", tf.__version__)
print("์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ์žฅ์น˜:", tf.config.list_physical_devices())