Virtual Cleint

client

example

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM, TextStreamer

MODEL_ID = "jaeyong2/Virtual-Client-Preview"

torch_dtype = torch.bfloat16 if torch.cuda.is_available() else torch.float32

tokenizer = AutoTokenizer.from_pretrained(MODEL_ID, use_fast=True)
model = AutoModelForCausalLM.from_pretrained(
    MODEL_ID,
    torch_dtype=torch_dtype,
    device_map="auto",
)

persona = "Pilates trainer with extensive gym experience"
messages = [
    {"role": "system", "content": "You are a question-generating AI that receives personas from users and generates the most appropriate questions"},
    {"role": "user", "content": persona}
]
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=512
)

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]

result

What are some of the key principles you follow when designing a new workout program?

How to make dataset

dataset

License

Acknowledgement

This research is supported by TPU Research Cloud program.

Downloads last month
79
Safetensors
Model size
1.54B params
Tensor type
BF16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for jaeyong2/Virtual-Client

Quantizations
1 model