umarigan/GPTeacher-General-Instruct-tr
Viewer • Updated • 25.8k • 65 • 3
How to use umarigan/LLama-3-8B-Instruction-tr with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="umarigan/LLama-3-8B-Instruction-tr") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("umarigan/LLama-3-8B-Instruction-tr")
model = AutoModelForCausalLM.from_pretrained("umarigan/LLama-3-8B-Instruction-tr")How to use umarigan/LLama-3-8B-Instruction-tr with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "umarigan/LLama-3-8B-Instruction-tr"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "umarigan/LLama-3-8B-Instruction-tr",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/umarigan/LLama-3-8B-Instruction-tr
How to use umarigan/LLama-3-8B-Instruction-tr with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "umarigan/LLama-3-8B-Instruction-tr" \
--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": "umarigan/LLama-3-8B-Instruction-tr",
"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 "umarigan/LLama-3-8B-Instruction-tr" \
--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": "umarigan/LLama-3-8B-Instruction-tr",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use umarigan/LLama-3-8B-Instruction-tr with Unsloth Studio:
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for umarigan/LLama-3-8B-Instruction-tr to start chatting
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for umarigan/LLama-3-8B-Instruction-tr to start chatting
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for umarigan/LLama-3-8B-Instruction-tr to start chatting
pip install unsloth
from unsloth import FastModel
model, tokenizer = FastModel.from_pretrained(
model_name="umarigan/LLama-3-8B-Instruction-tr",
max_seq_length=2048,
)How to use umarigan/LLama-3-8B-Instruction-tr with Docker Model Runner:
docker model run hf.co/umarigan/LLama-3-8B-Instruction-tr
This llama model was trained 2x faster with Unsloth and Huggingface's TRL library.
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("umarigan/LLama-3-8B-Instruction-tr")
model = AutoModelForCausalLM.from_pretrained("umarigan/LLama-3-8B-Instruction-tr")
alpaca_prompt = """
Görev:
{}
Girdi:
{}
Cevap:
{}"""
inputs = tokenizer(
[
alpaca_prompt.format(
"bir haftada 3 kilo verebileceğim 5 öneri sunabilir misin?", # Görev
"", # Girdi
"", # Cevap - boş bırakın!
)
], return_tensors = "pt")
outputs = model.generate(**inputs, max_new_tokens = 64, use_cache = True)
tokenizer.batch_decode(outputs)
Output:
<|begin_of_text|> Görev: bir haftada 3 kilo verebileceğim 5 öneri sunabilir misin?
Girdi:
Cevap:
1. Yemeklerinizde daha az tuz kullanın. 2. Daha fazla sebze ve meyve tüketin. 3. Daha fazla su için. 4. Daha fazla egzersiz yapın. 5. Daha fazla uyku alın.<|end_of_text|>
Base model
meta-llama/Meta-Llama-3-8B