Instructions to use PanosAnag/llama-3.1-ecommerce-analyzer with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use PanosAnag/llama-3.1-ecommerce-analyzer with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("E:\Machine Learning\hf_cache\hub\models--meta-llama--Meta-Llama-3.1-8B-Instruct\snapshots\0e9e39f249a16976918f6564b8830bc894c89659") model = PeftModel.from_pretrained(base_model, "PanosAnag/llama-3.1-ecommerce-analyzer") - Transformers
How to use PanosAnag/llama-3.1-ecommerce-analyzer with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="PanosAnag/llama-3.1-ecommerce-analyzer") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("PanosAnag/llama-3.1-ecommerce-analyzer", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use PanosAnag/llama-3.1-ecommerce-analyzer with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "PanosAnag/llama-3.1-ecommerce-analyzer" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PanosAnag/llama-3.1-ecommerce-analyzer", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/PanosAnag/llama-3.1-ecommerce-analyzer
- SGLang
How to use PanosAnag/llama-3.1-ecommerce-analyzer 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 "PanosAnag/llama-3.1-ecommerce-analyzer" \ --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": "PanosAnag/llama-3.1-ecommerce-analyzer", "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 "PanosAnag/llama-3.1-ecommerce-analyzer" \ --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": "PanosAnag/llama-3.1-ecommerce-analyzer", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use PanosAnag/llama-3.1-ecommerce-analyzer with Docker Model Runner:
docker model run hf.co/PanosAnag/llama-3.1-ecommerce-analyzer
MarketLens β AI Product Intelligence
Fine-tuned from meta-llama/Meta-Llama-3.1-8B-Instruct using QLoRA for two e-commerce tasks:
- Product Analysis β WINNER / LOSER / RISKY verdicts with red flags, market truth, and investment recommendation
- Ad Copy Generation β hooks, headlines, primary text, and CTA for Meta Ads, TikTok, Google
Training
- Base model:
meta-llama/Meta-Llama-3.1-8B-Instruct - Method: QLoRA (4-bit NF4, LoRA rank 16, alpha 32)
- Dataset: 150,000 examples (75K product analysis + 75K marketing copy)
- Source: McAuley-Lab/Amazon-Reviews-2023 β 25 categories, 135,235 real products with reviews
What each training example contains
PRODUCT: [real product title]
CATEGORY: [category]
PRICE: [price]
AVERAGE RATING: [X/5] (N reviews)
DESCRIPTION: [real product description]
FEATURES: [real product features]
CUSTOMER REVIEWS:
[β
ββββ] [real review text]
[β
β
β
β
β
] [real review text]
β VERDICT: WINNER/LOSER/RISKY + full analysis
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
from peft import PeftModel
import torch
BASE_MODEL = "meta-llama/Meta-Llama-3.1-8B-Instruct"
LORA_MODEL = "PanosAnag/llama-3.1-ecommerce-analyzer"
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.float16,
)
tokenizer = AutoTokenizer.from_pretrained(LORA_MODEL)
model = AutoModelForCausalLM.from_pretrained(BASE_MODEL, quantization_config=bnb_config, device_map="auto")
model = PeftModel.from_pretrained(model, LORA_MODEL)
model.eval()
GitHub
https://github.com/PanagiotisAnag/llama-3.1-ecommerce-analyzer
Framework Versions
- PEFT 0.19.1
- TRL 0.24.0
- Transformers 5.5.0
- PyTorch 2.6.0+cu124
- Downloads last month
- 49
Model tree for PanosAnag/llama-3.1-ecommerce-analyzer
Base model
meta-llama/Llama-3.1-8B Finetuned
meta-llama/Llama-3.1-8B-Instruct