if (FALSE) {
# Load a chat model
model <- model_load("path/to/chat_model.gguf")
# Format a conversation
messages <- list(
list(role = "system", content = "You are a helpful assistant."),
list(role = "user", content = "What is machine learning?"),
list(role = "assistant", content = "Machine learning is..."),
list(role = "user", content = "Give me an example.")
)
# Apply chat template
formatted_prompt <- apply_chat_template(model, messages)
# Generate response
response <- quick_llama(formatted_prompt)
}
Run the code above in your browser using DataLab