Text Generation
Transformers
Safetensors
English
phi3
Ecommerce
Phi-3.5
Fine-tuned
conversational
custom_code
text-generation-inference
Instructions to use kingabzpro/Phi-3.5-mini-instruct-Ecommerce-Text-Classification with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kingabzpro/Phi-3.5-mini-instruct-Ecommerce-Text-Classification with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="kingabzpro/Phi-3.5-mini-instruct-Ecommerce-Text-Classification", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("kingabzpro/Phi-3.5-mini-instruct-Ecommerce-Text-Classification", trust_remote_code=True) model = AutoModelForMultimodalLM.from_pretrained("kingabzpro/Phi-3.5-mini-instruct-Ecommerce-Text-Classification", 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 Settings
- vLLM
How to use kingabzpro/Phi-3.5-mini-instruct-Ecommerce-Text-Classification with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "kingabzpro/Phi-3.5-mini-instruct-Ecommerce-Text-Classification" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kingabzpro/Phi-3.5-mini-instruct-Ecommerce-Text-Classification", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/kingabzpro/Phi-3.5-mini-instruct-Ecommerce-Text-Classification
- SGLang
How to use kingabzpro/Phi-3.5-mini-instruct-Ecommerce-Text-Classification 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 "kingabzpro/Phi-3.5-mini-instruct-Ecommerce-Text-Classification" \ --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": "kingabzpro/Phi-3.5-mini-instruct-Ecommerce-Text-Classification", "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 "kingabzpro/Phi-3.5-mini-instruct-Ecommerce-Text-Classification" \ --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": "kingabzpro/Phi-3.5-mini-instruct-Ecommerce-Text-Classification", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use kingabzpro/Phi-3.5-mini-instruct-Ecommerce-Text-Classification with Docker Model Runner:
docker model run hf.co/kingabzpro/Phi-3.5-mini-instruct-Ecommerce-Text-Classification
Update README.md
Browse files
README.md
CHANGED
|
@@ -68,8 +68,10 @@ Accuracy for label Electronics: 0.825
|
|
| 68 |
Accuracy for label Household: 0.926
|
| 69 |
Accuracy for label Books: 0.683
|
| 70 |
Accuracy for label Clothing: 0.947
|
| 71 |
-
|
| 72 |
**Classification Report:**
|
|
|
|
|
|
|
| 73 |
precision recall f1-score support
|
| 74 |
|
| 75 |
Electronics 0.97 0.82 0.89 40
|
|
@@ -80,9 +82,11 @@ Accuracy for label Clothing: 0.947
|
|
| 80 |
micro avg 0.90 0.86 0.88 200
|
| 81 |
macro avg 0.91 0.85 0.87 200
|
| 82 |
weighted avg 0.90 0.86 0.88 200
|
| 83 |
-
|
| 84 |
|
| 85 |
**Confusion Matrix:**
|
|
|
|
|
|
|
| 86 |
[[33 6 1 0]
|
| 87 |
[ 1 75 2 3]
|
| 88 |
[ 0 3 28 2]
|
|
|
|
| 68 |
Accuracy for label Household: 0.926
|
| 69 |
Accuracy for label Books: 0.683
|
| 70 |
Accuracy for label Clothing: 0.947
|
| 71 |
+
```
|
| 72 |
**Classification Report:**
|
| 73 |
+
|
| 74 |
+
```bash
|
| 75 |
precision recall f1-score support
|
| 76 |
|
| 77 |
Electronics 0.97 0.82 0.89 40
|
|
|
|
| 82 |
micro avg 0.90 0.86 0.88 200
|
| 83 |
macro avg 0.91 0.85 0.87 200
|
| 84 |
weighted avg 0.90 0.86 0.88 200
|
| 85 |
+
```
|
| 86 |
|
| 87 |
**Confusion Matrix:**
|
| 88 |
+
|
| 89 |
+
```bash
|
| 90 |
[[33 6 1 0]
|
| 91 |
[ 1 75 2 3]
|
| 92 |
[ 0 3 28 2]
|