Instructions to use PDG/gpt2_for_crime_classification with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use PDG/gpt2_for_crime_classification with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="PDG/gpt2_for_crime_classification")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("PDG/gpt2_for_crime_classification") model = AutoModelForSequenceClassification.from_pretrained("PDG/gpt2_for_crime_classification", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download config.json from PDG/gpt2_for_crime_classification: direct link, hf CLI and curl.
- Browser
- Download file 1.38 kB
-
https://huggingface.co/PDG/gpt2_for_crime_classification/resolve/main/config.json
- Command line
-
hf download hf://PDG/gpt2_for_crime_classification/config.json
-
curl -L -o config.json https://huggingface.co/PDG/gpt2_for_crime_classification/resolve/main/config.json
1.38 kB
| { | |
| "_name_or_path": "gpt2-large", | |
| "activation_function": "gelu_new", | |
| "architectures": [ | |
| "GPT2ForSequenceClassification" | |
| ], | |
| "attn_pdrop": 0.1, | |
| "bos_token_id": 50256, | |
| "embd_pdrop": 0.1, | |
| "eos_token_id": 50256, | |
| "id2label": { | |
| "0": "Raub", | |
| "1": "Diebstahl", | |
| "2": "T\u00f6tungsdelikt", | |
| "3": "Sonstiges", | |
| "4": "K\u00f6rperverletzung", | |
| "5": "Drogendelikt", | |
| "6": "Bedrohung", | |
| "7": "Sexualdelikt" | |
| }, | |
| "initializer_range": 0.02, | |
| "label2id": { | |
| "LABEL_0": 0, | |
| "LABEL_1": 1, | |
| "LABEL_2": 2, | |
| "LABEL_3": 3, | |
| "LABEL_4": 4, | |
| "LABEL_5": 5, | |
| "LABEL_6": 6, | |
| "LABEL_7": 7 | |
| }, | |
| "layer_norm_epsilon": 1e-05, | |
| "model_type": "gpt2", | |
| "n_ctx": 1024, | |
| "n_embd": 1280, | |
| "n_head": 20, | |
| "n_inner": null, | |
| "n_layer": 36, | |
| "n_positions": 1024, | |
| "pad_token_id": 50258, | |
| "problem_type": "multi_label_classification", | |
| "reorder_and_upcast_attn": false, | |
| "resid_pdrop": 0.1, | |
| "scale_attn_by_inverse_layer_idx": false, | |
| "scale_attn_weights": true, | |
| "summary_activation": null, | |
| "summary_first_dropout": 0.1, | |
| "summary_proj_to_labels": true, | |
| "summary_type": "cls_index", | |
| "summary_use_proj": true, | |
| "task_specific_params": { | |
| "text-generation": { | |
| "do_sample": true, | |
| "max_length": 50 | |
| } | |
| }, | |
| "torch_dtype": "float32", | |
| "transformers_version": "4.26.0", | |
| "use_cache": true, | |
| "vocab_size": 50258 | |
| } | |