hf_ez_conversational: Create a Conversational Agent

View source: R/ez.R

hf_ez_conversationalR Documentation

Create a Conversational Agent

Description

This task corresponds to any chatbot like structure. Models tend to have shorter max_length, so please check with caution when using a given model if you need long range dependency or not.

Usage

hf_ez_conversational(model_id = "microsoft/DialoGPT-large", use_api = FALSE)

Arguments

model_id

A model_id. Run hf_search_models(...) for model_ids. Defaults to 'microsoft/DialoGPT-large'.

use_api

Whether to use the Inference API to run the model (TRUE) or download and run the model locally (FALSE). Defaults to FALSE

Value

A conversational object

See Also

https://huggingface.co/docs/api-inference/detailed_parameters#zero-shot-classification-task

Examples

## Not run: 
# Load the default model
ez <- hf_ez_conversational()

# Continue the conversation
ez$infer(past_user_inputs = list("Which movie is the best ?"), generated_responses = list("It's Die Hard for sure."), text = "Can you explain why?", min_length = 10, max_length = 50)

## End(Not run)

farach/huggingfaceR documentation built on Feb. 4, 2023, 10:31 p.m.