BaSalam/entity-attribute-dataset-GPT-3.5-generated-v1
Viewer • Updated • 306k • 35 • 3
How to use BaSalam/Llama2-7b-entity-attr-v1 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="BaSalam/Llama2-7b-entity-attr-v1") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("BaSalam/Llama2-7b-entity-attr-v1")
model = AutoModelForCausalLM.from_pretrained("BaSalam/Llama2-7b-entity-attr-v1")How to use BaSalam/Llama2-7b-entity-attr-v1 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "BaSalam/Llama2-7b-entity-attr-v1"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "BaSalam/Llama2-7b-entity-attr-v1",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/BaSalam/Llama2-7b-entity-attr-v1
How to use BaSalam/Llama2-7b-entity-attr-v1 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "BaSalam/Llama2-7b-entity-attr-v1" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "BaSalam/Llama2-7b-entity-attr-v1",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "BaSalam/Llama2-7b-entity-attr-v1" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "BaSalam/Llama2-7b-entity-attr-v1",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use BaSalam/Llama2-7b-entity-attr-v1 with Docker Model Runner:
docker model run hf.co/BaSalam/Llama2-7b-entity-attr-v1
This is a custom LLM fine tuned on LLama 2 based on Basalam products to infer enitty (product types) and attributes based on product data. You can use it on any similar dataset.
prompt = """instruction': \"here is a product title from a Iranian marketplace. \n give me
the Product Entity and Attributes of this product in Persian language.\n give the output in
this json format: {'attributes': {'attribute_name' : <attribute value>, ...}, 'product_entity':
'<product entity>'}.\n Don't make assumptions about what values to plug into json. Just give
Json not a single word more.\n \nproduct title:"""
title = """: ست شابلون ژله ای دو قلو صریر 20سانتی 1 عدد
1 عدد ست شابلون ژله ای دو قلو سریر 20سانتی متر
با کیفیت مناسب و صادراتی
شامل دو تکه شابلون ژله ای
در چهار رنگ سبز، قرمز، نارنجی و آبی موجود است.
پخش لوازم التحریر کیان""""
{
"attributes": {
"تعداد تکه": "2",
"طول": "20 سانتیمتر",
"رنگها": "سبز، قرمز، نارنجی، آبی",
"کیفیت": "مناسب و صادراتی"
},
"product_entity": "ست شابلون ژله ای"
}