dspy
dspy copied to clipboard
DSPy: The framework for programming—not prompting—language models
I'm getting this error when running MIPRO: ``` AttributeError: 'Predict' object has no attribute 'new_signature'. Did you mean: 'signature'? ``` This is how I run MIPRO: ``` teleprompter = dspy.teleprompt.MIPRO(metric...
dspy.Google does not work properly as it always results in KeyError: 'max_tokens'. The problem stems from line 95 in dsp/primitives/predict.py ``` max_tokens = kwargs.get("max_tokens", dsp.settings.lm.kwargs["max_tokens"]) ``` This creates a key...
Following the pattern from the simple RAG Example in the docs, I've created a DatabricksRM which works when calling like `rm(query="Model serving API", query_type="text")` But when trying to use dspy.settings.configure(rm=rm)...
``` from pydantic import BaseModel, Field from dspy.functional import TypedPredictor class TravelInformation(BaseModel): origin: str = Field(pattern=r"^[A-Z]{3}$") destination: str = Field(pattern=r"^[A-Z]{3}$") date: datetime.date confidence: float = Field(gt=0, lt=1) class TravelSignature(Signature): """...
Issue: Reasoning is concatenated with any one of the output fields at random. I have a signature with one input field and three output fields. Each of the fields have...
Testing with Llama-3 70B, was seeing duplicate generations. I traced it to this code in predict.py: ``` for completion in completions: if all((completion.get(key, "") != "") for key in field_names):...
I am trying to parellelize the calls to the OpeanAI API using the ThreadPoolExecutor, within the function that each thread runs I have the following: ``` model = CoT(signature) answer...
I want to try using DSPy to optimize some sub-instructions for a model with a very specific prompt format. Specifically, I want to optimize usage of [Prometheus Eval](https://huggingface.co/prometheus-eval/prometheus-7b-v2.0) where it...
Consider this DSPy program: ```python demos = [dspy.Example(input="What is the speed of light?", output="3e8")] program = LabeledFewShot(k=len(demos)).compile( student=dspy.TypedPredictor("input -> thoughts, output"), trainset=[ex.with_inputs("input") for ex in demos], ) dspy.settings.configure(lm=DummyLM(["My thoughts", "Paris"]))...
`dsp.modules.lm` is nearly all special cases: We should think about how to move those decisions into the LM subclasses instead. Maybe this is already happening in the backend refactor @KCaverly...