HuggingfaceClient.Inference.Task.TextGeneration
(huggingface_client v0.1.0)
Copy Markdown
View Source
Text generation (completion) task.
Example
{:ok, result} = HuggingfaceClient.text_generation(client, %{
model: "gpt2",
inputs: "The answer to the universe is"
})
IO.puts(result["generated_text"])
Summary
Functions
@spec run(HuggingfaceClient.Client.t(), map()) :: {:ok, map()} | {:error, Exception.t()}
@spec stream(HuggingfaceClient.Client.t(), map()) :: {:ok, Enumerable.t()} | {:error, Exception.t()}