Vikhrmodels/GrandMaster-PRO-MAX
Viewer • Updated • 155k • 534 • 77
How to use attn-signs/Watari-7b-v0.5 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="attn-signs/Watari-7b-v0.5")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForMultimodalLM
tokenizer = AutoTokenizer.from_pretrained("attn-signs/Watari-7b-v0.5")
model = AutoModelForMultimodalLM.from_pretrained("attn-signs/Watari-7b-v0.5")
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.5 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "attn-signs/Watari-7b-v0.5"
# 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.5",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/attn-signs/Watari-7b-v0.5
How to use attn-signs/Watari-7b-v0.5 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.5" \
--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.5",
"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.5" \
--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.5",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use attn-signs/Watari-7b-v0.5 with Docker Model Runner:
docker model run hf.co/attn-signs/Watari-7b-v0.5
The further conversions/upgrade are much appreciated and welcomed, feel free to join.
[https://huggingface.co/mradermacher/Watari-7b-v0.5-GGUF]
Repo id: mradermacher/Watari-7b-v0.5-GGUF
Utilized DeepSpeed (Stage 3) and HF.Accelerator for distributed training.
from transformers import AutoTokenizer, AutoModelForCausalLM
repo = 'attn-signs/Watari-7b-v0.5'
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)
Черная дыра — это космическое объект с такой мощной гравитацией, что ничто, даже свет, не может покинуть её пределы после достижения определённой точки, называемой горизонтом событий. Это явление было названо "черной дырой" потому, что она поглощает все, включая свет, делая её невидимой для наблюдений.
Уравнение, описывающее черную дыру, является частью общей теории относительности Эйнштейна. Оно выражается через уравнение Шварцшильда, которое описывает пространство-время вокруг черной дыры. Уравнение имеет следующий вид:
\[ ds^2 = -c^2 dt^2 + \left(1 - \frac{2GM}{Rc^2}\right) dr^2 + r^2 d\theta^2 + r^2 \sin^2(\theta) d\phi^2 \]
где:
- \( ds^2 \) — элемент квадрата интервала,
- \( c \) — скорость света в вакууме,
- \( G \) — гравитационная постоянная Ньютона,
- \( M \) — масса черной дыры,
- \( R \) — радиус Шварцшильда, который равен \( 2GM/c^2 \),
- \( d\theta \) и \( d\phi \) — угловые координаты в сферической системе координат,
- \( \theta \) — полярный угол (от 0 до \( \pi \)),
- \( \phi \) — азимутальный угол (от 0 до \( 2\pi \)).
Это уравнение показывает, как пространство и время искривляются вокруг черной дыры. В точке \( r = 0 \) (горизонте событий) кривизна пространства-времени стремится к бесконечности, что является математическим способом описания того, что невозможно наблюдать за тем, что происходит внутри черной дыры.