Skip to content

armgit / dspy

Public Imported from GitHub
0

DSPy: The framework for programming—not prompting—language models

Python

feature(dspy): refined missing hf error

Alejandro Barónbdc9b98e7380
diff --git a/dsp/modules/hf.py b/dsp/modules/hf.py
index fb4027731..d775d48da 100644
--- a/dsp/modules/hf.py
+++ b/dsp/modules/hf.py
@@ -72,7 +72,7 @@ class HFModel(LM):
from transformers import AutoConfig, AutoModelForCausalLM, AutoModelForSeq2SeqLM, AutoTokenizer
except ImportError as exc:
raise ModuleNotFoundError(
- "You need to install Hugging Face transformers library to use HF models.",
+ "You need to install Hugging Face transformers (with torch dependencies) library to use HF models.",
) from exc
self.device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
try:
diff --git a/dspy/retrieve/pinecone_rm.py b/dspy/retrieve/pinecone_rm.py
index 0b5518e96..6c8a793a4 100644
--- a/dspy/retrieve/pinecone_rm.py
+++ b/dspy/retrieve/pinecone_rm.py
@@ -85,7 +85,7 @@ class PineconeRM(Retrieve):
from transformers import AutoModel, AutoTokenizer
except ImportError as exc:
raise ModuleNotFoundError(
- "You need to install Hugging Face transformers library to use a local embedding model with PineconeRM.",
+ "You need to install Hugging Face transformers (with torch dependencies) library to use a local embedding model with PineconeRM.",
) from exc
self._local_embed_model = AutoModel.from_pretrained(local_embed_model)