<start_of_turn>system
Ты — Сайга, русскоязычный автоматический ассистент. Ты разговариваешь с людьми и помогаешь им.<end_of_turn>
<start_of_turn>user
Как дела?<end_of_turn>
<start_of_turn>model
Отлично, а у тебя?<end_of_turn>
<start_of_turn>user
Шикарно. Как пройти в библиотеку?<end_of_turn>
<start_of_turn>model
Code example
# Исключительно ознакомительный пример.# НЕ НАДО ТАК ИНФЕРИТЬ МОДЕЛЬ В ПРОДЕ.# См. https://github.com/vllm-project/vllm или https://github.com/huggingface/text-generation-inferenceimport torch
from transformers import AutoModelForCausalLM, AutoTokenizer, GenerationConfig
MODEL_NAME = "IlyaGusev/saiga_gemma2_10b"
model = AutoModelForCausalLM.from_pretrained(
MODEL_NAME,
load_in_8bit=True,
torch_dtype=torch.bfloat16,
device_map="auto"
)
model.eval()
tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME)
generation_config = GenerationConfig.from_pretrained(MODEL_NAME)
print(generation_config)
inputs = ["Почему трава зеленая?", "Сочини длинный рассказ, обязательно упоминая следующие объекты. Дано: Таня, мяч"]
for query in inputs:
prompt = tokenizer.apply_chat_template([{
"role": "user",
"content": query
}], tokenize=False, add_generation_prompt=True)
data = tokenizer(prompt, return_tensors="pt", add_special_tokens=False)
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).strip()
print(query)
print(output)
print()
print("==============================")
print()
saiga_gemma2_9b huggingface.co is an AI model on huggingface.co that provides saiga_gemma2_9b's model effect (), which can be used instantly with this IlyaGusev saiga_gemma2_9b model. huggingface.co supports a free trial of the saiga_gemma2_9b model, and also provides paid use of the saiga_gemma2_9b. Support call saiga_gemma2_9b model through api, including Node.js, Python, http.
saiga_gemma2_9b huggingface.co is an online trial and call api platform, which integrates saiga_gemma2_9b's modeling effects, including api services, and provides a free online trial of saiga_gemma2_9b, you can try saiga_gemma2_9b online for free by clicking the link below.
IlyaGusev saiga_gemma2_9b online free url in huggingface.co:
saiga_gemma2_9b is an open source model from GitHub that offers a free installation service, and any user can find saiga_gemma2_9b on GitHub to install. At the same time, huggingface.co provides the effect of saiga_gemma2_9b install, users can directly use saiga_gemma2_9b installed effect in huggingface.co for debugging and trial. It also supports api for free installation.