|
|
|
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()) |
|
|
|
import os |
|
import tensorflow as tf |
|
|
|
|
|
os.environ['TF_ENABLE_ONEDNN_OPTS'] = '0' |
|
|
|
|
|
os.environ["CUDA_VISIBLE_DEVICES"] = "-1" |
|
|
|
|
|
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()) |
|
|
|
|
|
FROM python:3.10-slim |
|
|
|
|
|
RUN pip install --no-cache-dir pip==22.3.1 \ |
|
&& pip install --no-cache-dir datasets "huggingface-hub>=0.19" \ |
|
"hf-transfer>=0.1.4" "protobuf<4" "click<8.1" "pydantic~=1.0" |
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
git git-lfs ffmpeg libsm6 libxext6 cmake rsync libgl1-mesa-glx \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
WORKDIR /home/user/app |
|
|
|
|
|
COPY requirements.txt . |
|
RUN pip install --no-cache-dir -r requirements.txt |
|
|
|
|
|
COPY . . |
|
|
|
|
|
CMD ["streamlit", "run", "app.py"] |
|
|
|
import streamlit as st |
|
|
|
st.title("Hello, Streamlit!") |
|
st.write("This is a sample Streamlit app.") |
|
|
|
|