QuixiAI/samantha-data
Updated • 714 • 142
How to use aloobun/qwen-1_8b-samantha-chat with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="aloobun/qwen-1_8b-samantha-chat", trust_remote_code=True) # Load model directly
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("aloobun/qwen-1_8b-samantha-chat", trust_remote_code=True, dtype="auto")How to use aloobun/qwen-1_8b-samantha-chat with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "aloobun/qwen-1_8b-samantha-chat"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "aloobun/qwen-1_8b-samantha-chat",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/aloobun/qwen-1_8b-samantha-chat
How to use aloobun/qwen-1_8b-samantha-chat with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "aloobun/qwen-1_8b-samantha-chat" \
--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": "aloobun/qwen-1_8b-samantha-chat",
"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 "aloobun/qwen-1_8b-samantha-chat" \
--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": "aloobun/qwen-1_8b-samantha-chat",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use aloobun/qwen-1_8b-samantha-chat with Docker Model Runner:
docker model run hf.co/aloobun/qwen-1_8b-samantha-chat
This my first attempt at finetuning the Qwen 1.8B model on samantha dataset. I've added a bit of my own stuff as well. Give it a go and tell me what you think.
from transformers import AutoModelForCausalLM, AutoTokenizer, GenerationConfig
tokenizer = AutoTokenizer.from_pretrained("qwen-1_8b-samantha-chat", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("qwen-1_8b-samantha-chat", device_map="auto", trust_remote_code=True).eval()
response, history = model.chat(tokenizer, "How can we take care of our mental health every day?", history=None)
print(response)
It's important to remember that everyone's needs and circumstances are different, so some strategies may work better for one person than another. However, there are several simple things you can do to help improve your mental well-being:
1. Establish healthy boundaries and prioritize self-care activities like exercise, meditation, or spending time with friends.
2. Practice active listening and empathize with others, as it can foster strong connections.
3. Build positive relationships by being open-minded and supportive in your interactions.
4. Engage in activities that bring you joy, such as creative pursuits, hobbies, or exploring new places.
By implementing these tips, you'll be able to maintain an optimal balance between personal development and your overall emotional well-being.