if (FALSE) {
# Load model and create context
model <- model_load("path/to/model.gguf")
ctx <- context_create(model, n_ctx = 2048)
response <- generate(ctx, "Hello, how are you?", max_tokens = 50)
# Creative writing with higher temperature
story <- generate(ctx, "Once upon a time", max_tokens = 200, temperature = 0.8)
# Prevent repetition
no_repeat <- generate(ctx, "Tell me about AI",
repeat_last_n = 64,
penalty_repeat = 1.1)
# Clean output (remove special tokens)
clean_output <- generate(ctx, "Explain quantum physics", clean = TRUE)
}
Run the code above in your browser using DataLab