Text Generation
Transformers
PyTorch
TensorFlow
JAX
Rust
gpt2
conversational
text-generation-inference
Instructions to use william4416/bewtesttwo with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use william4416/bewtesttwo with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="william4416/bewtesttwo") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("william4416/bewtesttwo") model = AutoModelForCausalLM.from_pretrained("william4416/bewtesttwo") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use william4416/bewtesttwo with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "william4416/bewtesttwo" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "william4416/bewtesttwo", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/william4416/bewtesttwo
- SGLang
How to use william4416/bewtesttwo 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 "william4416/bewtesttwo" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "william4416/bewtesttwo", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "william4416/bewtesttwo" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "william4416/bewtesttwo", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use william4416/bewtesttwo with Docker Model Runner:
docker model run hf.co/william4416/bewtesttwo
Upload 10 files
Browse files- config (2).json +30 -0
- flax_model (1).msgpack +3 -0
- generation_config (2).json +6 -0
- generation_config_for_conversational.json +7 -0
- merges (1).txt +0 -0
- pytorch_model (1).bin +3 -0
- rust_model (1).ot +3 -0
- tf_model (1).h5 +3 -0
- tokenizer_config (2).json +23 -0
- vocab (1).json +0 -0
config (2).json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"activation_function": "gelu_new",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"GPT2LMHeadModel"
|
| 5 |
+
],
|
| 6 |
+
"attn_pdrop": 0.1,
|
| 7 |
+
"bos_token_id": 50256,
|
| 8 |
+
"embd_pdrop": 0.1,
|
| 9 |
+
"eos_token_id": 50256,
|
| 10 |
+
"initializer_range": 0.02,
|
| 11 |
+
"layer_norm_epsilon": 1e-05,
|
| 12 |
+
"model_type": "gpt2",
|
| 13 |
+
"n_ctx": 1024,
|
| 14 |
+
"n_embd": 1024,
|
| 15 |
+
"n_head": 16,
|
| 16 |
+
"n_layer": 24,
|
| 17 |
+
"n_positions": 1024,
|
| 18 |
+
"resid_pdrop": 0.1,
|
| 19 |
+
"summary_activation": null,
|
| 20 |
+
"summary_first_dropout": 0.1,
|
| 21 |
+
"summary_proj_to_labels": true,
|
| 22 |
+
"summary_type": "cls_index",
|
| 23 |
+
"summary_use_proj": true,
|
| 24 |
+
"task_specific_params": {
|
| 25 |
+
"conversational": {
|
| 26 |
+
"max_length": 1000
|
| 27 |
+
}
|
| 28 |
+
},
|
| 29 |
+
"vocab_size": 50257
|
| 30 |
+
}
|
flax_model (1).msgpack
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fafcbe08b61770a25fb539420430ceeaecba2e9414c6f4fb6ad5270d6997b397
|
| 3 |
+
size 1419302302
|
generation_config (2).json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 50256,
|
| 4 |
+
"eos_token_id": 50256,
|
| 5 |
+
"transformers_version": "4.27.0.dev0"
|
| 6 |
+
}
|
generation_config_for_conversational.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 50256,
|
| 4 |
+
"eos_token_id": 50256,
|
| 5 |
+
"max_length": 1000,
|
| 6 |
+
"transformers_version": "4.27.0.dev0"
|
| 7 |
+
}
|
merges (1).txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
pytorch_model (1).bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d2214b95438592f420ef4df037d9c72ddf993fb6877479fb09320b757f96cfa7
|
| 3 |
+
size 862955157
|
rust_model (1).ot
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:46ca590456e201e1e75d7671e0f8cb281fffaca72659772345e75ec844ffa04c
|
| 3 |
+
size 1725881760
|
tf_model (1).h5
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9d5afacddabe4a40f517064a81747acab952a1b494f74f5ceee109ba0bb7f300
|
| 3 |
+
size 1419628976
|
tokenizer_config (2).json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_bos_token": false,
|
| 3 |
+
"add_prefix_space": false,
|
| 4 |
+
"added_tokens_decoder": {
|
| 5 |
+
"50256": {
|
| 6 |
+
"content": "<|endoftext|>",
|
| 7 |
+
"lstrip": false,
|
| 8 |
+
"normalized": true,
|
| 9 |
+
"rstrip": false,
|
| 10 |
+
"single_word": false,
|
| 11 |
+
"special": true
|
| 12 |
+
}
|
| 13 |
+
},
|
| 14 |
+
"bos_token": "<|endoftext|>",
|
| 15 |
+
"chat_template": "{% for message in messages %}{{ message.content }}{{ eos_token }}{% endfor %}",
|
| 16 |
+
"clean_up_tokenization_spaces": true,
|
| 17 |
+
"eos_token": "<|endoftext|>",
|
| 18 |
+
"errors": "replace",
|
| 19 |
+
"model_max_length": 1024,
|
| 20 |
+
"pad_token": null,
|
| 21 |
+
"tokenizer_class": "GPT2Tokenizer",
|
| 22 |
+
"unk_token": "<|endoftext|>"
|
| 23 |
+
}
|
vocab (1).json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|