Instructions to use Nehc/gpt2_lovecraft_ru with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Nehc/gpt2_lovecraft_ru with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Nehc/gpt2_lovecraft_ru")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Nehc/gpt2_lovecraft_ru") model = AutoModelForCausalLM.from_pretrained("Nehc/gpt2_lovecraft_ru", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Nehc/gpt2_lovecraft_ru with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Nehc/gpt2_lovecraft_ru" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Nehc/gpt2_lovecraft_ru", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Nehc/gpt2_lovecraft_ru
- SGLang
How to use Nehc/gpt2_lovecraft_ru with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Nehc/gpt2_lovecraft_ru" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Nehc/gpt2_lovecraft_ru", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Nehc/gpt2_lovecraft_ru" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Nehc/gpt2_lovecraft_ru", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Nehc/gpt2_lovecraft_ru with Docker Model Runner:
docker model run hf.co/Nehc/gpt2_lovecraft_ru
Only 1 epoch
Browse files- config.json +5 -1
- pytorch_model.bin +2 -2
- tokenizer_config.json +1 -1
config.json
CHANGED
|
@@ -19,10 +19,14 @@
|
|
| 19 |
"n_layer": 12,
|
| 20 |
"n_positions": 2048,
|
| 21 |
"resid_pdrop": 0.1,
|
|
|
|
| 22 |
"summary_activation": null,
|
| 23 |
"summary_first_dropout": 0.1,
|
| 24 |
"summary_proj_to_labels": true,
|
| 25 |
"summary_type": "cls_index",
|
| 26 |
"summary_use_proj": true,
|
| 27 |
-
"
|
|
|
|
|
|
|
|
|
|
| 28 |
}
|
|
|
|
| 19 |
"n_layer": 12,
|
| 20 |
"n_positions": 2048,
|
| 21 |
"resid_pdrop": 0.1,
|
| 22 |
+
"scale_attn_weights": true,
|
| 23 |
"summary_activation": null,
|
| 24 |
"summary_first_dropout": 0.1,
|
| 25 |
"summary_proj_to_labels": true,
|
| 26 |
"summary_type": "cls_index",
|
| 27 |
"summary_use_proj": true,
|
| 28 |
+
"torch_dtype": "float32",
|
| 29 |
+
"transformers_version": "4.11.0.dev0",
|
| 30 |
+
"use_cache": true,
|
| 31 |
+
"vocab_size": 50258
|
| 32 |
}
|
pytorch_model.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5e1ae8797e32efea642c8229680912818e409fc645eae8934e44caf383b5ab96
|
| 3 |
+
size 551298921
|
tokenizer_config.json
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"errors": "replace", "unk_token": {"content": "<|endoftext|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true, "__type": "AddedToken"}, "bos_token": {"content": "<|endoftext|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true, "__type": "AddedToken"}, "eos_token": {"content": "<|endoftext|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true, "__type": "AddedToken"}, "add_prefix_space": false, "special_tokens_map_file": null, "
|
|
|
|
| 1 |
+
{"errors": "replace", "unk_token": {"content": "<|endoftext|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true, "__type": "AddedToken"}, "bos_token": {"content": "<|endoftext|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true, "__type": "AddedToken"}, "eos_token": {"content": "<|endoftext|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true, "__type": "AddedToken"}, "add_prefix_space": false, "special_tokens_map_file": null, "name_or_path": "workflow", "tokenizer_file": "workflow\\tokenizer.json", "tokenizer_class": "GPT2Tokenizer"}
|