diff --git a/convokit/forecaster/__init__.py b/convokit/forecaster/__init__.py index 12a13760..618f4af8 100644 --- a/convokit/forecaster/__init__.py +++ b/convokit/forecaster/__init__.py @@ -24,7 +24,7 @@ or "datasets" in str(e) ): raise ImportError( - "TransformerDecoderModel requires ML dependencies. Run 'pip install convokit[llm]' to install them." + "TransformerDecoderModel requires ML dependencies. Run 'pip install convokit[llm]' to install them (or 'pip install convokit[llm-mac]' if you are on macOS)." ) from e else: raise @@ -39,7 +39,7 @@ or "datasets" in str(e) ): raise ImportError( - "TransformerEncoderModel requires ML dependencies. Run 'pip install convokit[llm]' to install them." + "TransformerEncoderModel requires ML dependencies. Run 'pip install convokit[llm]' to install them (or 'pip install convokit[llm-mac]' if you are on macOS)." ) from e else: raise diff --git a/convokit/pivotal_framework/__init__.py b/convokit/pivotal_framework/__init__.py index ffb536ad..d13aedcf 100644 --- a/convokit/pivotal_framework/__init__.py +++ b/convokit/pivotal_framework/__init__.py @@ -12,7 +12,7 @@ or "transformers" in str(e) ): raise ImportError( - "Pivotal framework requires ML dependencies. Run 'pip install convokit[llm]' to install them." + "Pivotal framework requires ML dependencies. Run 'pip install convokit[llm]' to install them (or 'pip install convokit[llm-mac]' if you are on macOS)." ) from e else: raise diff --git a/convokit/redirection/__init__.py b/convokit/redirection/__init__.py index 920db570..bcbb5c88 100644 --- a/convokit/redirection/__init__.py +++ b/convokit/redirection/__init__.py @@ -3,7 +3,7 @@ except (ImportError, ModuleNotFoundError) as e: if "torch" in str(e) or "not currently installed" in str(e): raise ImportError( - "Redirection module requires ML dependencies. Run 'pip install convokit[llm]' to install them." + "Redirection module requires ML dependencies. Run 'pip install convokit[llm]' to install them (or 'pip install convokit[llm-mac]' if you are on macOS)." ) from e else: raise @@ -13,7 +13,7 @@ except (ImportError, ModuleNotFoundError) as e: if "not currently installed" in str(e): raise ImportError( - "LikelihoodModel requires ML dependencies. Run 'pip install convokit[llm]' to install them." + "LikelihoodModel requires ML dependencies. Run 'pip install convokit[llm]' to install them (or 'pip install convokit[llm-mac]' if you are on macOS)." ) from e else: raise diff --git a/convokit/utterance_likelihood/__init__.py b/convokit/utterance_likelihood/__init__.py index ca8f6e91..bd197b7b 100644 --- a/convokit/utterance_likelihood/__init__.py +++ b/convokit/utterance_likelihood/__init__.py @@ -3,7 +3,7 @@ except (ImportError, ModuleNotFoundError) as e: if "torch" in str(e) or "datasets" in str(e) or "not currently installed" in str(e): raise ImportError( - "UtteranceLikelihood requires ML dependencies. Run 'pip install convokit[llm]' to install them." + "UtteranceLikelihood requires ML dependencies. Run 'pip install convokit[llm]' to install them (or 'pip install convokit[llm-mac]' if you are on macOS)." ) from e else: raise diff --git a/convokit/utterance_simulator/__init__.py b/convokit/utterance_simulator/__init__.py index 8c37e7c0..41171bb8 100644 --- a/convokit/utterance_simulator/__init__.py +++ b/convokit/utterance_simulator/__init__.py @@ -16,7 +16,7 @@ or "datasets" in str(e) ): raise ImportError( - "UnslothUtteranceSimulatorModel requires ML dependencies. Run 'pip install convokit[llm]' to install them." + "UnslothUtteranceSimulatorModel requires ML dependencies. Run 'pip install convokit[llm]' to install them (or 'pip install convokit[llm-mac]' if you are on macOS)." ) from e else: raise diff --git a/docs/source/pivotal.rst b/docs/source/pivotal.rst index ddbfe203..ad8dd6a6 100644 --- a/docs/source/pivotal.rst +++ b/docs/source/pivotal.rst @@ -1,6 +1,6 @@ Pivotal Moment Measure ==================================== -Please note: this transformer requires installing convokit with the optional LLM packages via `pip install convokit[llm]` +Please note: this transformer requires installing convokit with the optional LLM packages via `pip install convokit[llm]` (or `pip install convokit[llm-mac]` if you are on macOS) The `PivotalMomentMeasure` transformer identifies pivotal moments in conversations as described in this `paper `_. diff --git a/docs/source/redirectionAndUtteranceLikelihood.rst b/docs/source/redirectionAndUtteranceLikelihood.rst index cc25987a..b23ece81 100644 --- a/docs/source/redirectionAndUtteranceLikelihood.rst +++ b/docs/source/redirectionAndUtteranceLikelihood.rst @@ -1,6 +1,6 @@ Redirection and Utterance Likelihood ==================================== -Please note: this transformer requires installing convokit with the optional LLM packages via `pip install convokit[llm]` +Please note: this transformer requires installing convokit with the optional LLM packages via `pip install convokit[llm]` (or `pip install convokit[llm-mac]` if you are on macOS) The `Redirection` transformer measures the extent to which utterances redirect the flow of the conversation, diff --git a/docs/source/transformerdecodermodel.rst b/docs/source/transformerdecodermodel.rst index 353aa6f0..ce657a29 100644 --- a/docs/source/transformerdecodermodel.rst +++ b/docs/source/transformerdecodermodel.rst @@ -1,6 +1,6 @@ Transformer Decoder-based Forecasting Model =========================================== -Please note: this transformer requires installing convokit with the optional LLM packages via `pip install convokit[llm]` +Please note: this transformer requires installing convokit with the optional LLM packages via `pip install convokit[llm]` (or `pip install convokit[llm-mac]` if you are on macOS) A ConvoKit Forecaster-adherent implementation of conversational forecasting model based on Transformer Decoder Model (e.g. LlaMA, Gemma, GPT). This class is first used in the paper "Conversations Gone Awry, But Then? Evaluating Conversational Forecasting Models" (Tran et al., 2025). diff --git a/docs/source/transformerencodermodel.rst b/docs/source/transformerencodermodel.rst index 2ab478f4..14cb8e02 100644 --- a/docs/source/transformerencodermodel.rst +++ b/docs/source/transformerencodermodel.rst @@ -1,6 +1,6 @@ Transformer Encoder-based Forecasting Model =========================================== -Please note: this transformer requires installing convokit with the optional LLM packages via `pip install convokit[llm]`. +Please note: this transformer requires installing convokit with the optional LLM packages via `pip install convokit[llm]` (or `pip install convokit[llm-mac]` if you are on macOS). A ConvoKit Forecaster-adherent implementation of conversational forecasting model based on Transformer Encoder Model (e.g. BERT, RoBERTa, SpanBERT, DeBERTa). This class is first used in the paper "Conversations Gone Awry, But Then? Evaluating Conversational Forecasting Models"(Tran et al., 2025). diff --git a/setup.py b/setup.py index 796b4168..68378e38 100644 --- a/setup.py +++ b/setup.py @@ -99,6 +99,17 @@ "tensorflow>=2.18.0", "tf-keras>=2.17.0,<3.0.0", ], + "llm-mac": [ + "torch>=2.0.0", + "accelerate", + "peft", + "bitsandbytes", + "transformers", + "unsloth[apple-silicon]", # https://github.com/yhsung/unsloth/blob/c2a368b26f5febd9dd4cd39cabc73da67c1f1eb1/APPLE_SILICON.md + "mlx>=0.20.0", + "trl>=0.12.2", + "tensorflow>=2.13.0", + ], }, classifiers=[ "Programming Language :: Python",