Text Generation
Transformers
Safetensors
English
mistral
dpo
biology
education
zephyr
conversational
text-generation-inference
Instructions to use kangqi-ni/zephyr-7b-beta_bio-tutor_dpo with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kangqi-ni/zephyr-7b-beta_bio-tutor_dpo with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="kangqi-ni/zephyr-7b-beta_bio-tutor_dpo") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("kangqi-ni/zephyr-7b-beta_bio-tutor_dpo") model = AutoModelForCausalLM.from_pretrained("kangqi-ni/zephyr-7b-beta_bio-tutor_dpo", device_map="auto") 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 kangqi-ni/zephyr-7b-beta_bio-tutor_dpo with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "kangqi-ni/zephyr-7b-beta_bio-tutor_dpo" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kangqi-ni/zephyr-7b-beta_bio-tutor_dpo", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/kangqi-ni/zephyr-7b-beta_bio-tutor_dpo
- SGLang
How to use kangqi-ni/zephyr-7b-beta_bio-tutor_dpo 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 "kangqi-ni/zephyr-7b-beta_bio-tutor_dpo" \ --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": "kangqi-ni/zephyr-7b-beta_bio-tutor_dpo", "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 "kangqi-ni/zephyr-7b-beta_bio-tutor_dpo" \ --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": "kangqi-ni/zephyr-7b-beta_bio-tutor_dpo", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use kangqi-ni/zephyr-7b-beta_bio-tutor_dpo with Docker Model Runner:
docker model run hf.co/kangqi-ni/zephyr-7b-beta_bio-tutor_dpo
Kevin Ni commited on
Commit ·
6a96fde
1
Parent(s): 03f5544
upload the model
Browse files- config.json +3 -2
- generation_config.json +1 -1
- model-00001-of-00003.safetensors +1 -1
- model-00002-of-00003.safetensors +1 -1
- model-00003-of-00003.safetensors +1 -1
- tokenizer.json +0 -0
- tokenizer_config.json +1 -0
- training_args.bin +2 -2
config.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
| 1 |
{
|
| 2 |
-
"_name_or_path": "/
|
| 3 |
"architectures": [
|
| 4 |
"MistralForCausalLM"
|
| 5 |
],
|
| 6 |
"attention_dropout": 0.0,
|
| 7 |
"bos_token_id": 1,
|
| 8 |
"eos_token_id": 2,
|
|
|
|
| 9 |
"hidden_act": "silu",
|
| 10 |
"hidden_size": 4096,
|
| 11 |
"initializer_range": 0.02,
|
|
@@ -21,7 +22,7 @@
|
|
| 21 |
"sliding_window": 4096,
|
| 22 |
"tie_word_embeddings": false,
|
| 23 |
"torch_dtype": "bfloat16",
|
| 24 |
-
"transformers_version": "4.
|
| 25 |
"use_cache": true,
|
| 26 |
"vocab_size": 32000
|
| 27 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"_name_or_path": "/data1/kn22/spock_bio/spock_bio_zephyr-7b-beta_1",
|
| 3 |
"architectures": [
|
| 4 |
"MistralForCausalLM"
|
| 5 |
],
|
| 6 |
"attention_dropout": 0.0,
|
| 7 |
"bos_token_id": 1,
|
| 8 |
"eos_token_id": 2,
|
| 9 |
+
"head_dim": 128,
|
| 10 |
"hidden_act": "silu",
|
| 11 |
"hidden_size": 4096,
|
| 12 |
"initializer_range": 0.02,
|
|
|
|
| 22 |
"sliding_window": 4096,
|
| 23 |
"tie_word_embeddings": false,
|
| 24 |
"torch_dtype": "bfloat16",
|
| 25 |
+
"transformers_version": "4.44.2",
|
| 26 |
"use_cache": true,
|
| 27 |
"vocab_size": 32000
|
| 28 |
}
|
generation_config.json
CHANGED
|
@@ -2,5 +2,5 @@
|
|
| 2 |
"_from_model_config": true,
|
| 3 |
"bos_token_id": 1,
|
| 4 |
"eos_token_id": 2,
|
| 5 |
-
"transformers_version": "4.
|
| 6 |
}
|
|
|
|
| 2 |
"_from_model_config": true,
|
| 3 |
"bos_token_id": 1,
|
| 4 |
"eos_token_id": 2,
|
| 5 |
+
"transformers_version": "4.44.2"
|
| 6 |
}
|
model-00001-of-00003.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4943162336
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5601244ec8c45d544214d771b51e1695132656ed4456fd9b3763e08cfbcbb1a1
|
| 3 |
size 4943162336
|
model-00002-of-00003.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4999819336
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e2b564bb01b38411c62dcffa0a88c7c9f3473f682cb2bfd10c5fd7689706bde3
|
| 3 |
size 4999819336
|
model-00003-of-00003.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4540516344
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:122146e135471f295d7381dde92e46dd25b8f8b6a3ba6ce74b9c25d1aebe9094
|
| 3 |
size 4540516344
|
tokenizer.json
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
{
|
| 2 |
"add_bos_token": true,
|
| 3 |
"add_eos_token": false,
|
|
|
|
| 4 |
"added_tokens_decoder": {
|
| 5 |
"0": {
|
| 6 |
"content": "<unk>",
|
|
|
|
| 1 |
{
|
| 2 |
"add_bos_token": true,
|
| 3 |
"add_eos_token": false,
|
| 4 |
+
"add_prefix_space": true,
|
| 5 |
"added_tokens_decoder": {
|
| 6 |
"0": {
|
| 7 |
"content": "<unk>",
|
training_args.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:1a92b95216427e2d58a1e6d62a8c8b19b28a2ad88b2486ecbe462770ac3ff574
|
| 3 |
+
size 7288
|