View source: R/service-huggingface.R
create_completion_huggingface | R Documentation |
Generate text completions using HuggingFace's API
create_completion_huggingface(
prompt,
history = NULL,
model = "tiiuae/falcon-7b-instruct",
token = Sys.getenv("HF_API_KEY"),
max_new_tokens = 250
)
prompt |
The prompt for generating completions |
history |
A list of the previous chat responses |
model |
The model to use for generating text |
token |
The API key for accessing HuggingFace's API. By default, the
function will try to use the |
max_new_tokens |
Maximum number of tokens to generate, defaults to 250 |
A list with the generated completions and other information returned by the API.
## Not run:
create_completion_huggingface(
model = "gpt2",
prompt = "Hello world!"
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.