Instructions to use GunMan0410/Image_Profanity with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use GunMan0410/Image_Profanity with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="GunMan0410/Image_Profanity") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# pip install -U transformers accelerate # Load model directly from transformers import AutoImageProcessor, AutoModelForImageClassification processor = AutoImageProcessor.from_pretrained("GunMan0410/Image_Profanity") model = AutoModelForImageClassification.from_pretrained("GunMan0410/Image_Profanity", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload 7 files
Browse files- all_results.json +7 -0
- config.json +38 -0
- model.safetensors +3 -0
- preprocessor_config.json +36 -0
- train_results.json +7 -0
- trainer_state.json +72 -0
- training_args.bin +3 -0
all_results.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"epoch": 4.0,
|
| 3 |
+
"train_loss": 0.24850207471343524,
|
| 4 |
+
"train_runtime": 2032.99,
|
| 5 |
+
"train_samples_per_second": 0.527,
|
| 6 |
+
"train_steps_per_second": 0.033
|
| 7 |
+
}
|
config.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "google/vit-base-patch16-224",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"ViTForImageClassification"
|
| 5 |
+
],
|
| 6 |
+
"attention_probs_dropout_prob": 0.0,
|
| 7 |
+
"encoder_stride": 16,
|
| 8 |
+
"hidden_act": "gelu",
|
| 9 |
+
"hidden_dropout_prob": 0.0,
|
| 10 |
+
"hidden_size": 768,
|
| 11 |
+
"id2label": {
|
| 12 |
+
"0": "Harassment and Bullying",
|
| 13 |
+
"1": "drug",
|
| 14 |
+
"2": "hentai",
|
| 15 |
+
"3": "neutral",
|
| 16 |
+
"4": "religious"
|
| 17 |
+
},
|
| 18 |
+
"image_size": 224,
|
| 19 |
+
"initializer_range": 0.02,
|
| 20 |
+
"intermediate_size": 3072,
|
| 21 |
+
"label2id": {
|
| 22 |
+
"Harassment and Bullying": "0",
|
| 23 |
+
"drug": "1",
|
| 24 |
+
"hentai": "2",
|
| 25 |
+
"neutral": "3",
|
| 26 |
+
"religious": "4"
|
| 27 |
+
},
|
| 28 |
+
"layer_norm_eps": 1e-12,
|
| 29 |
+
"model_type": "vit",
|
| 30 |
+
"num_attention_heads": 12,
|
| 31 |
+
"num_channels": 3,
|
| 32 |
+
"num_hidden_layers": 12,
|
| 33 |
+
"patch_size": 16,
|
| 34 |
+
"problem_type": "single_label_classification",
|
| 35 |
+
"qkv_bias": true,
|
| 36 |
+
"torch_dtype": "float32",
|
| 37 |
+
"transformers_version": "4.39.3"
|
| 38 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3bd5f32a2173c70503714c5e83cb861f0c6bc33bf3630e3005adcf5daceb233a
|
| 3 |
+
size 343233204
|
preprocessor_config.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_valid_processor_keys": [
|
| 3 |
+
"images",
|
| 4 |
+
"do_resize",
|
| 5 |
+
"size",
|
| 6 |
+
"resample",
|
| 7 |
+
"do_rescale",
|
| 8 |
+
"rescale_factor",
|
| 9 |
+
"do_normalize",
|
| 10 |
+
"image_mean",
|
| 11 |
+
"image_std",
|
| 12 |
+
"return_tensors",
|
| 13 |
+
"data_format",
|
| 14 |
+
"input_data_format"
|
| 15 |
+
],
|
| 16 |
+
"do_normalize": true,
|
| 17 |
+
"do_rescale": true,
|
| 18 |
+
"do_resize": "google/vit-base-patch16-224",
|
| 19 |
+
"image_mean": [
|
| 20 |
+
0.5,
|
| 21 |
+
0.5,
|
| 22 |
+
0.5
|
| 23 |
+
],
|
| 24 |
+
"image_processor_type": "ViTFeatureExtractor",
|
| 25 |
+
"image_std": [
|
| 26 |
+
0.5,
|
| 27 |
+
0.5,
|
| 28 |
+
0.5
|
| 29 |
+
],
|
| 30 |
+
"resample": 2,
|
| 31 |
+
"rescale_factor": 0.00392156862745098,
|
| 32 |
+
"size": {
|
| 33 |
+
"height": 224,
|
| 34 |
+
"width": 224
|
| 35 |
+
}
|
| 36 |
+
}
|
train_results.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"epoch": 4.0,
|
| 3 |
+
"train_loss": 0.24850207471343524,
|
| 4 |
+
"train_runtime": 2032.99,
|
| 5 |
+
"train_samples_per_second": 0.527,
|
| 6 |
+
"train_steps_per_second": 0.033
|
| 7 |
+
}
|
trainer_state.json
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"best_metric": null,
|
| 3 |
+
"best_model_checkpoint": null,
|
| 4 |
+
"epoch": 4.0,
|
| 5 |
+
"eval_steps": 100,
|
| 6 |
+
"global_step": 68,
|
| 7 |
+
"is_hyper_param_search": false,
|
| 8 |
+
"is_local_process_zero": true,
|
| 9 |
+
"is_world_process_zero": true,
|
| 10 |
+
"log_history": [
|
| 11 |
+
{
|
| 12 |
+
"epoch": 0.59,
|
| 13 |
+
"grad_norm": 6.594244480133057,
|
| 14 |
+
"learning_rate": 0.00017058823529411766,
|
| 15 |
+
"loss": 1.1113,
|
| 16 |
+
"step": 10
|
| 17 |
+
},
|
| 18 |
+
{
|
| 19 |
+
"epoch": 1.18,
|
| 20 |
+
"grad_norm": 4.991268157958984,
|
| 21 |
+
"learning_rate": 0.0001411764705882353,
|
| 22 |
+
"loss": 0.3493,
|
| 23 |
+
"step": 20
|
| 24 |
+
},
|
| 25 |
+
{
|
| 26 |
+
"epoch": 1.76,
|
| 27 |
+
"grad_norm": 1.9102413654327393,
|
| 28 |
+
"learning_rate": 0.00011176470588235294,
|
| 29 |
+
"loss": 0.1408,
|
| 30 |
+
"step": 30
|
| 31 |
+
},
|
| 32 |
+
{
|
| 33 |
+
"epoch": 2.35,
|
| 34 |
+
"grad_norm": 0.4147999584674835,
|
| 35 |
+
"learning_rate": 8.23529411764706e-05,
|
| 36 |
+
"loss": 0.0649,
|
| 37 |
+
"step": 40
|
| 38 |
+
},
|
| 39 |
+
{
|
| 40 |
+
"epoch": 2.94,
|
| 41 |
+
"grad_norm": 0.49450424313545227,
|
| 42 |
+
"learning_rate": 5.294117647058824e-05,
|
| 43 |
+
"loss": 0.0148,
|
| 44 |
+
"step": 50
|
| 45 |
+
},
|
| 46 |
+
{
|
| 47 |
+
"epoch": 3.53,
|
| 48 |
+
"grad_norm": 0.0802285373210907,
|
| 49 |
+
"learning_rate": 2.3529411764705884e-05,
|
| 50 |
+
"loss": 0.0059,
|
| 51 |
+
"step": 60
|
| 52 |
+
},
|
| 53 |
+
{
|
| 54 |
+
"epoch": 4.0,
|
| 55 |
+
"step": 68,
|
| 56 |
+
"total_flos": 8.30736464952361e+16,
|
| 57 |
+
"train_loss": 0.24850207471343524,
|
| 58 |
+
"train_runtime": 2032.99,
|
| 59 |
+
"train_samples_per_second": 0.527,
|
| 60 |
+
"train_steps_per_second": 0.033
|
| 61 |
+
}
|
| 62 |
+
],
|
| 63 |
+
"logging_steps": 10,
|
| 64 |
+
"max_steps": 68,
|
| 65 |
+
"num_input_tokens_seen": 0,
|
| 66 |
+
"num_train_epochs": 4,
|
| 67 |
+
"save_steps": 100,
|
| 68 |
+
"total_flos": 8.30736464952361e+16,
|
| 69 |
+
"train_batch_size": 16,
|
| 70 |
+
"trial_name": null,
|
| 71 |
+
"trial_params": null
|
| 72 |
+
}
|
training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d602e65f64392a04d20958d0d862fca5b6a282a34ac823b0b62c90b33f9f235d
|
| 3 |
+
size 4920
|