Vikhrmodels / Vikhr-7B-instruct_0.2

huggingface.co
Total runs: 102
24-hour runs: 0
7-day runs: -109
30-day runs: -810
Model's Last Updated: October 18 2024
text-generation

Introduction of Vikhr-7B-instruct_0.2

Model Details of Vikhr-7B-instruct_0.2

GGUF версия: https://huggingface.co/pirbis/Vikhr-7B-instruct_0.2-GGUF

from peft import PeftModel, PeftConfig
from transformers import AutoModelForCausalLM, AutoTokenizer, GenerationConfig
import torch
import os
os.environ['HF_HOME']='.'
MODEL_NAME = "Vikhrmodels/Vikhr-7B-instruct_0.2"
DEFAULT_MESSAGE_TEMPLATE = "<s>{role}\n{content}</s>\n"
DEFAULT_SYSTEM_PROMPT = "Ты — Вихрь, русскоязычный автоматический ассистент. Ты разговариваешь с людьми и помогаешь им."

class Conversation:
    def __init__(
        self,
        message_template=DEFAULT_MESSAGE_TEMPLATE,
        system_prompt=DEFAULT_SYSTEM_PROMPT,
    ):
        self.message_template = message_template
        self.messages = [{
            "role": "system",
            "content": system_prompt
        }]

    def add_user_message(self, message):
        self.messages.append({
            "role": "user",
            "content": message
        })

    def get_prompt(self, tokenizer):
        final_text = ""
        for message in self.messages:
            message_text = self.message_template.format(**message)
            final_text += message_text
        final_text += 'bot'
        return final_text.strip()


def generate(model, tokenizer, prompt, generation_config):
    data = tokenizer(prompt, return_tensors="pt")
    data = {k: v.to(model.device) for k, v in data.items()}
    output_ids = model.generate(
        **data,
        generation_config=generation_config
    )[0]
    output_ids = output_ids[len(data["input_ids"][0]):]
    output = tokenizer.decode(output_ids, skip_special_tokens=True)
    return output.strip()

#config = PeftConfig.from_pretrained(MODEL_NAME)
model = AutoModelForCausalLM.from_pretrained(
    MODEL_NAME,
    load_in_8bit=True,
    torch_dtype=torch.float16,
    device_map="auto"
)
#model = PeftModel.from_pretrained(    model,   MODEL_NAME,   torch_dtype=torch.float16)
model.eval()

tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME, use_fast=False)

generation_config = GenerationConfig.from_pretrained(MODEL_NAME)
generation_config.max_length=256
generation_config.top_p=0.9
generation_config.top_k=30
generation_config.do_sample = True
print(generation_config)

inputs = ["Как тебя зовут?", "Кто такой Колмогоров?"]

for inp in inputs:
    conversation = Conversation()
    conversation.add_user_message(inp)
    prompt = conversation.get_prompt(tokenizer)

    output = generate(model, tokenizer, prompt, generation_config)
    print(inp)
    print(output)
    print('\n')

wandb

Runs of Vikhrmodels Vikhr-7B-instruct_0.2 on huggingface.co

102
Total runs
0
24-hour runs
0
3-day runs
-109
7-day runs
-810
30-day runs

More Information About Vikhr-7B-instruct_0.2 huggingface.co Model

Vikhr-7B-instruct_0.2 huggingface.co

Vikhr-7B-instruct_0.2 huggingface.co is an AI model on huggingface.co that provides Vikhr-7B-instruct_0.2's model effect (), which can be used instantly with this Vikhrmodels Vikhr-7B-instruct_0.2 model. huggingface.co supports a free trial of the Vikhr-7B-instruct_0.2 model, and also provides paid use of the Vikhr-7B-instruct_0.2. Support call Vikhr-7B-instruct_0.2 model through api, including Node.js, Python, http.

Vikhr-7B-instruct_0.2 huggingface.co Url

https://huggingface.co/Vikhrmodels/Vikhr-7B-instruct_0.2

Vikhrmodels Vikhr-7B-instruct_0.2 online free

Vikhr-7B-instruct_0.2 huggingface.co is an online trial and call api platform, which integrates Vikhr-7B-instruct_0.2's modeling effects, including api services, and provides a free online trial of Vikhr-7B-instruct_0.2, you can try Vikhr-7B-instruct_0.2 online for free by clicking the link below.

Vikhrmodels Vikhr-7B-instruct_0.2 online free url in huggingface.co:

https://huggingface.co/Vikhrmodels/Vikhr-7B-instruct_0.2

Vikhr-7B-instruct_0.2 install

Vikhr-7B-instruct_0.2 is an open source model from GitHub that offers a free installation service, and any user can find Vikhr-7B-instruct_0.2 on GitHub to install. At the same time, huggingface.co provides the effect of Vikhr-7B-instruct_0.2 install, users can directly use Vikhr-7B-instruct_0.2 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

Vikhr-7B-instruct_0.2 install url in huggingface.co:

https://huggingface.co/Vikhrmodels/Vikhr-7B-instruct_0.2

Url of Vikhr-7B-instruct_0.2

Vikhr-7B-instruct_0.2 huggingface.co Url

Provider of Vikhr-7B-instruct_0.2 huggingface.co

Vikhrmodels
ORGANIZATIONS

Other API from Vikhrmodels

huggingface.co

Total runs: 77.1K
Run Growth: 76.8K
Growth Rate: 99.55%
Updated:September 18 2025
huggingface.co

Total runs: 12
Run Growth: 6
Growth Rate: 50.00%
Updated:January 30 2025
huggingface.co

Total runs: 9
Run Growth: 4
Growth Rate: 44.44%
Updated:June 11 2025