using var client = new HuggingFaceClient(apiKey);
var response = await client.GenerateTextAsync(
"gpt2",
new GenerateTextRequest
{
Inputs = "Give random 5 words in response",
Parameters = new GenerateTextRequestParameters
{
MaxNewTokens = 250,
},
Options = new GenerateTextRequestOptions(),
});
foreach (var value in response)
{
Console.WriteLine(value.GeneratedText);
}