Text Generation
Transformers
Safetensors
PEFT
qwen2
Trained with AutoTrain
text-generation-inference
conversational
8-bit precision
bitsandbytes
Instructions to use POWERHACK/TheoVersion2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use POWERHACK/TheoVersion2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="POWERHACK/TheoVersion2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("POWERHACK/TheoVersion2") model = AutoModelForCausalLM.from_pretrained("POWERHACK/TheoVersion2") 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]:])) - PEFT
How to use POWERHACK/TheoVersion2 with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use POWERHACK/TheoVersion2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "POWERHACK/TheoVersion2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "POWERHACK/TheoVersion2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/POWERHACK/TheoVersion2
- SGLang
How to use POWERHACK/TheoVersion2 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 "POWERHACK/TheoVersion2" \ --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": "POWERHACK/TheoVersion2", "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 "POWERHACK/TheoVersion2" \ --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": "POWERHACK/TheoVersion2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use POWERHACK/TheoVersion2 with Docker Model Runner:
docker model run hf.co/POWERHACK/TheoVersion2
Update config.json
Browse files- config.json +21 -5
config.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
{
|
|
|
|
| 2 |
"architectures": [
|
| 3 |
"Qwen2ForCausalLM"
|
| 4 |
],
|
|
@@ -15,14 +16,29 @@
|
|
| 15 |
"num_attention_heads": 16,
|
| 16 |
"num_hidden_layers": 36,
|
| 17 |
"num_key_value_heads": 2,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
"rms_norm_eps": 1e-06,
|
| 19 |
"rope_theta": 1000000.0,
|
| 20 |
-
"sliding_window":
|
| 21 |
"tie_word_embeddings": true,
|
| 22 |
"torch_dtype": "bfloat16",
|
| 23 |
-
"transformers_version": "4.
|
| 24 |
-
"use_cache":
|
| 25 |
"use_mrope": false,
|
| 26 |
"use_sliding_window": false,
|
| 27 |
-
"vocab_size":
|
| 28 |
-
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"_name_or_path": "Qwen/Qwen2.5-3B",
|
| 3 |
"architectures": [
|
| 4 |
"Qwen2ForCausalLM"
|
| 5 |
],
|
|
|
|
| 16 |
"num_attention_heads": 16,
|
| 17 |
"num_hidden_layers": 36,
|
| 18 |
"num_key_value_heads": 2,
|
| 19 |
+
"quantization_config": {
|
| 20 |
+
"_load_in_4bit": false,
|
| 21 |
+
"_load_in_8bit": true,
|
| 22 |
+
"bnb_4bit_compute_dtype": "float32",
|
| 23 |
+
"bnb_4bit_quant_storage": "uint8",
|
| 24 |
+
"bnb_4bit_quant_type": "fp4",
|
| 25 |
+
"bnb_4bit_use_double_quant": false,
|
| 26 |
+
"llm_int8_enable_fp32_cpu_offload": false,
|
| 27 |
+
"llm_int8_has_fp16_weight": false,
|
| 28 |
+
"llm_int8_skip_modules": null,
|
| 29 |
+
"llm_int8_threshold": 6.0,
|
| 30 |
+
"load_in_4bit": false,
|
| 31 |
+
"load_in_8bit": true,
|
| 32 |
+
"quant_method": "bitsandbytes"
|
| 33 |
+
},
|
| 34 |
"rms_norm_eps": 1e-06,
|
| 35 |
"rope_theta": 1000000.0,
|
| 36 |
+
"sliding_window": null,
|
| 37 |
"tie_word_embeddings": true,
|
| 38 |
"torch_dtype": "bfloat16",
|
| 39 |
+
"transformers_version": "4.44.2",
|
| 40 |
+
"use_cache": false,
|
| 41 |
"use_mrope": false,
|
| 42 |
"use_sliding_window": false,
|
| 43 |
+
"vocab_size": 151665
|
| 44 |
+
}
|