Downloads · 30 days
0
yb1n/0521_deep_hw
0521_deep_hw is a machine learning model from yb1n. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
이 폴더는 Hugging Face 형식으로 사용할 수 있는 텍스트 분류 모델 코드와 IMDB 데이터 전처리 코드를 포함합니다.
Downloads · 30 days
0
Access
Public
Updated Jun 10, 2026
Repo size
—
Likes
0
Public
Click a slice to open those files.
.py10.1 KB · 73%
From the Hugging Face model README
이 폴더는 Hugging Face 형식으로 사용할 수 있는 텍스트 분류 모델 코드와 IMDB 데이터 전처리 코드를 포함합니다.
custom_text_config.py: 커스텀 모델 설정값을 정의합니다.custom_text_classifier.py: Hugging Face PreTrainedModel을 상속한 텍스트 분류 모델을 정의합니다.prepare_imdb_data.py: IMDB 데이터를 불러오고, 유효하지 않은 텍스트를 제거한 뒤 토큰화해서 저장합니다.check_batch_loss.py: 저장된 데이터셋을 불러와 한 배치에 대한 loss를 출력합니다.export_hf_model.py: 모델, 토크나이저, 설정 파일, 커스텀 코드, 모델 카드를 hf_model 폴더로 내보냅니다.upload_to_hub.py: 내보낸 hf_model 폴더를 Hugging Face 모델 저장소에 업로드합니다.uv sync
uv run python prepare_imdb_data.py
빠르게 동작만 확인하려면 샘플 수를 줄여 실행할 수 있습니다.
uv run python prepare_imdb_data.py --max-train-samples 128 --max-test-samples 64
uv run python check_batch_loss.py
uv run python export_hf_model.py
Hugging Face에 업로드할 모델 파일은 hf_model 폴더에 저장됩니다.
쓰기 권한이 있는 Hugging Face 토큰을 환경 변수로 설정한 뒤 업로드합니다.
$env:HF_TOKEN = "your_token_here"
uv run python upload_to_hub.py --repo-id username/custom-text-classifier
비공개 저장소로 만들려면 --private 옵션을 추가합니다.
uv run python upload_to_hub.py --repo-id username/custom-text-classifier --private