Vikhrmodels/GrandMaster-PRO-MAX
Viewer • Updated • 155k • 787 • 77
How to use attn-signs/Watari-7b-v0 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="attn-signs/Watari-7b-v0")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("attn-signs/Watari-7b-v0")
model = AutoModelForCausalLM.from_pretrained("attn-signs/Watari-7b-v0")
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]:]))How to use attn-signs/Watari-7b-v0 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "attn-signs/Watari-7b-v0"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "attn-signs/Watari-7b-v0",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/attn-signs/Watari-7b-v0
How to use attn-signs/Watari-7b-v0 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "attn-signs/Watari-7b-v0" \
--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": "attn-signs/Watari-7b-v0",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "attn-signs/Watari-7b-v0" \
--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": "attn-signs/Watari-7b-v0",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use attn-signs/Watari-7b-v0 with Docker Model Runner:
docker model run hf.co/attn-signs/Watari-7b-v0
The further conversions/upgrade are much appreciated and welcomed, feel free to join.
[https://huggingface.co/mradermacher/Watari-7b-v0-GGUF]
GGUF repo id: mradermacher/Watari-7b-v0-GGUF
Utilized DeepSpeed (Stage 3) and HF.Accelerator for distributed training.
from transformers import AutoTokenizer, AutoModelForCausalLM
repo = 'attn-signs/Watari-7b-v0'
model = AutoModelForCausalLM.from_pretrained(repo)
tokenizer = AutoTokenizer.from_pretrained(repo)
model.to('cuda')
prompt = 'Что такое хорошо, а что такое плохо?'
messages = [
{"role": "system", "content": "Ты Ватари, ассистент и помощник в решении различных задач. Отвечай на вопросы пользователя, рассуждая."},
{"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
generated_ids = model.generate(
**model_inputs,
max_new_tokens=1024
)
generated_ids = [
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(response)
Вопрос "Что такое хорошо, а что такое плохо?" является философским и субъективным, так как понятия "хорошо" и "плохо" могут иметь разные значения в зависимости от контекста и индивидуальных убеждений. Тем не менее, я могу привести общие определения этих понятий:
### Хорошо:
1. **Положительные эмоции**: Счастье, радость, благодарность.
2. **Добродетели**: Честь, доброта, честность.
3. **Успех**: Достижение целей и желаемых результатов.
4. **Здоровье**: Физическое и психическое благополучие.
5. **Духовное развитие**: Рост, самосовершенствование и самореализация.
### Плохо:
1. **Негативные эмоции**: Грусть, печаль, страх.
2. **Пороки**: Себялюбие, жадность, лжь.
3. **Неудачи**: Неспособность достичь целей и желаемых результатов.
4. **Болезнь**: Болезненные состояния и недуги.
5. **Падение духа**: Уныние, отчаяние, потеря мотивации.
Эти определения являются общими и могут варьироваться в зависимости от культурных, религиозных и личных взглядов каждого человека.