Text Generation
Transformers
Safetensors
phi3
conversational
custom_code
text-generation-inference
4-bit precision
gptq
Instructions to use Frinkles/QuantizedModel with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Frinkles/QuantizedModel with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Frinkles/QuantizedModel", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Frinkles/QuantizedModel", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("Frinkles/QuantizedModel", trust_remote_code=True) 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
- vLLM
How to use Frinkles/QuantizedModel with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Frinkles/QuantizedModel" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Frinkles/QuantizedModel", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Frinkles/QuantizedModel
- SGLang
How to use Frinkles/QuantizedModel 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 "Frinkles/QuantizedModel" \ --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": "Frinkles/QuantizedModel", "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 "Frinkles/QuantizedModel" \ --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": "Frinkles/QuantizedModel", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Frinkles/QuantizedModel with Docker Model Runner:
docker model run hf.co/Frinkles/QuantizedModel
Upload Phi3ForCausalLM
Browse files- config.json +9 -13
- model.safetensors +2 -2
config.json
CHANGED
|
@@ -24,19 +24,15 @@
|
|
| 24 |
"original_max_position_embeddings": 4096,
|
| 25 |
"pad_token_id": 32000,
|
| 26 |
"quantization_config": {
|
| 27 |
-
"
|
| 28 |
-
"
|
| 29 |
-
"
|
| 30 |
-
"
|
| 31 |
-
"
|
| 32 |
-
"
|
| 33 |
-
"
|
| 34 |
-
"
|
| 35 |
-
"
|
| 36 |
-
"llm_int8_threshold": 6.0,
|
| 37 |
-
"load_in_4bit": true,
|
| 38 |
-
"load_in_8bit": false,
|
| 39 |
-
"quant_method": "bitsandbytes"
|
| 40 |
},
|
| 41 |
"resid_pdrop": 0.0,
|
| 42 |
"rms_norm_eps": 1e-05,
|
|
|
|
| 24 |
"original_max_position_embeddings": 4096,
|
| 25 |
"pad_token_id": 32000,
|
| 26 |
"quantization_config": {
|
| 27 |
+
"bits": 4,
|
| 28 |
+
"damp_percent": 0.1,
|
| 29 |
+
"dataset": "wikitext2",
|
| 30 |
+
"desc_act": false,
|
| 31 |
+
"group_size": 128,
|
| 32 |
+
"modules_in_block_to_quantize": null,
|
| 33 |
+
"quant_method": "gptq",
|
| 34 |
+
"sym": true,
|
| 35 |
+
"true_sequential": true
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
},
|
| 37 |
"resid_pdrop": 0.0,
|
| 38 |
"rms_norm_eps": 1e-05,
|
model.safetensors
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:8cc2aa9e1daa06456ef8061063e9bade3fd2103ffb3eadcc5370c9a2888dda7b
|
| 3 |
+
size 2279413824
|