hf_ez_text_generation | R Documentation |
Use to continue text from a prompt. This is a very generic task.
hf_ez_text_generation(model_id = "gpt2", use_api = FALSE)
model_id |
A model_id. Run hf_search_models(...) for model_ids. Defaults to 'gpt2'. |
use_api |
Whether to use the Inference API to run the model (TRUE) or download and run the model locally (FALSE). Defaults to FALSE |
A text generation object
https://huggingface.co/docs/api-inference/detailed_parameters#text-generation-task
## Not run: # Load the default model and use local inference ez <- hf_ez_text_generation() ez$infer(string = 'The answer to the universe is') # Use the api for inference. ez <- hf_ez_text_generation(use_api = TRUE) ez$infer(string = 'The answer to the universe is') ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.