Skip to content

armgit / dspy

Public Imported from GitHub
0

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

Python

build fix

Herumb Shandilya21e4294c9071
diff --git a/docs/building-blocks/3-modules.md b/docs/building-blocks/3-modules.md
index 10247ee7d..54ecb13da 100644
--- a/docs/building-blocks/3-modules.md
+++ b/docs/building-blocks/3-modules.md
@@ -114,7 +114,7 @@ We also have some function-style modules:
6. **`dspy.majority`**: Can do basic voting to return the most popular response from a set of predictions.
-Check out further examples in [each module's respective guide](/api/modules/).
+Check out further examples in [each module's respective guide](/api/category/modules/).
## How do I compose multiple modules into a bigger program?
diff --git a/docs/building-blocks/solving_your_task.md b/docs/building-blocks/solving_your_task.md
index d91941ec5..b4ba1f14e 100644
--- a/docs/building-blocks/solving_your_task.md
+++ b/docs/building-blocks/solving_your_task.md
@@ -97,7 +97,7 @@ Here's the general guidance on getting started:
At this point, you are either very happy with everything (we've seen quite a few people get it right on first try with DSPy) or, more likely, you've made a lot of progress but you don't like something about the final program or the metric.
-At this point, go back to step 1 and revisit the major questions. Did you define your task well? Do you need to collect (or find online) more data for your problem? Do you want to update your metric? And do you want to use a more sophisticated optimizer? Do you need to consider advanced features like [DSPy Assertions](/docs/building-blocks/7-assertions)? Or, perhaps most importantly, do you want to add some more complexity or steps in your DSPy program itself? Do you want to use multiple optimizers in a sequence?
+At this point, go back to step 1 and revisit the major questions. Did you define your task well? Do you need to collect (or find online) more data for your problem? Do you want to update your metric? And do you want to use a more sophisticated optimizer? Do you need to consider advanced features like [DSPy Assertions](/docs/building-blocks/assertions)? Or, perhaps most importantly, do you want to add some more complexity or steps in your DSPy program itself? Do you want to use multiple optimizers in a sequence?
Iterative development is key. DSPy gives you the pieces to do that incrementally: iterating on your data, your program structure, your assertions, your metric, and your optimization steps.
diff --git a/docs/deep-dive/modules/guide.mdx b/docs/deep-dive/modules/guide.mdx
index da6389db9..db7cb7bac 100644
--- a/docs/deep-dive/modules/guide.mdx
+++ b/docs/deep-dive/modules/guide.mdx
@@ -127,7 +127,7 @@ True
The others are very similar, `dspy.ReAct` and `dspy.ProgramOfThought` etc. They mainly change the internal behavior with which your signature is implemented!
-Check out further examples in [each module's respective guide](/api/modules/).
+Check out further examples in [each module's respective guide](/api/category/modules/).
### 5) How do I compose multiple modules into a bigger program?
diff --git a/docs/tutorials/other_tutorial.md b/docs/tutorials/other_tutorial.md
index dfe65ee4e..4545eea7d 100644
--- a/docs/tutorials/other_tutorial.md
+++ b/docs/tutorials/other_tutorial.md
@@ -8,10 +8,10 @@ sidebar_position: 99999
| **Level** | **Tutorial** | **Run in Colab** | **Description** |
| --- | ------------- | ------------- | ------------- |
-| Beginner | [**Getting Started**](intro.ipynb) | [<img align="center" src="https://colab.research.google.com/assets/colab-badge.svg" />](https://colab.research.google.com/github/stanfordnlp/dspy/blob/main/intro.ipynb) | Introduces the basic building blocks in DSPy. Tackles the task of complex question answering with HotPotQA. |
-| Beginner | [**Minimal Working Example**](https://dspy-docs.vercel.app/docs/quick-start/minimal-example) | N/A | Builds and optimizes a very simple chain-of-thought program in DSPy for math question answering. Very short. |
-| Beginner | [**Compiling for Tricky Tasks**](examples/nli/scone/scone.ipynb) | N/A | Teaches LMs to reason about logical statements and negation. Uses GPT-4 to bootstrap few-shot CoT demonstations for GPT-3.5. Establishes a state-of-the-art result on [ScoNe](https://arxiv.org/abs/2305.19426). Contributed by [Chris Potts](https://twitter.com/ChrisGPotts/status/1740033519446057077). |
-| Beginner | [**Local Models & Custom Datasets**](skycamp2023.ipynb) | [<img align="center" src="https://colab.research.google.com/assets/colab-badge.svg" />](https://colab.research.google.com/github/stanfordnlp/dspy/blob/main/skycamp2023.ipynb) | Illustrates two different things together: how to use local models (Llama-2-13B in particular) and how to use your own data examples for training and development.
+| Beginner | [**Getting Started**](https://github.com/stanfordnlp/dspy/blob/main/intro.ipynb) | [<img align="center" src="https://colab.research.google.com/assets/colab-badge.svg" />](https://colab.research.google.com/github/stanfordnlp/dspy/blob/main/intro.ipynb) | Introduces the basic building blocks in DSPy. Tackles the task of complex question answering with HotPotQA. |
+| Beginner | [**Minimal Working Example**](/docs/quick-start/minimal-example) | N/A | Builds and optimizes a very simple chain-of-thought program in DSPy for math question answering. Very short. |
+| Beginner | [**Compiling for Tricky Tasks**](https://github.com/stanfordnlp/dspy/blob/main/examples/nli/scone/scone.ipynb) | N/A | Teaches LMs to reason about logical statements and negation. Uses GPT-4 to bootstrap few-shot CoT demonstations for GPT-3.5. Establishes a state-of-the-art result on [ScoNe](https://arxiv.org/abs/2305.19426). Contributed by [Chris Potts](https://twitter.com/ChrisGPotts/status/1740033519446057077). |
+| Beginner | [**Local Models & Custom Datasets**](https://github.com/stanfordnlp/dspy/blob/main/skycamp2023.ipynb) | [<img align="center" src="https://colab.research.google.com/assets/colab-badge.svg" />](https://colab.research.google.com/github/stanfordnlp/dspy/blob/main/skycamp2023.ipynb) | Illustrates two different things together: how to use local models (Llama-2-13B in particular) and how to use your own data examples for training and development.
| Intermediate | [**The DSPy Paper**](https://arxiv.org/abs/2310.03714) | N/A | Sections 3, 5, 6, and 7 of the DSPy paper can be consumed as a tutorial. They include explained code snippets, results, and discussions of the abstractions and API.
| Intermediate | [**DSPy Assertions**](https://arxiv.org/abs/2312.13382) | [<img align="center" src="https://colab.research.google.com/assets/colab-badge.svg" />](https://colab.research.google.com/github/stanfordnlp/dspy/blob/main/examples/longformqa/longformqa_assertions.ipynb) | Introduces example of applying DSPy Assertions while generating long-form responses to questions with citations. Presents comparative evaluation in both zero-shot and compiled settings.
| Intermediate | [**Finetuning for Complex Programs**](https://twitter.com/lateinteraction/status/1712135660797317577) | [<img align="center" src="https://colab.research.google.com/assets/colab-badge.svg" />](https://colab.research.google.com/github/stanfordnlp/dspy/blob/main/examples/qa/hotpot/multihop_finetune.ipynb) | Teaches a local T5 model (770M) to do exceptionally well on HotPotQA. Uses only 200 labeled answers. Uses no hand-written prompts, no calls to OpenAI, and no labels for retrieval or reasoning.
diff --git a/docs/tutorials/rag.md b/docs/tutorials/rag.md
index 79224debd..0560d10b5 100644
--- a/docs/tutorials/rag.md
+++ b/docs/tutorials/rag.md
@@ -10,7 +10,7 @@ RAG ensures LLMs can dynamically utilize real-time knowledge even if not origina
## Configuring LM and RM
-We'll start by setting up the language model (LM) and retrieval model (RM), which **DSPy** supports through multiple [LM](/docs/deep-dive/language_model_clients/remote_models/) and [RM](/docs/deep-dive/retrieval_models_clients/) APIs and [local models hosting](/docs/deep-dive/language_model_clients/local_models/).
+We'll start by setting up the language model (LM) and retrieval model (RM), which **DSPy** supports through multiple [LM](/docs/category/remote-language-model-clients) and [RM](/docs/category/retrieval-model-clients) APIs and [local models hosting](/docs/category/local-language-model-clients).
In this notebook, we'll work with GPT-3.5 (`gpt-3.5-turbo`) and the `ColBERTv2` retriever (a free server hosting a Wikipedia 2017 "abstracts" search index containing the first paragraph of each article from this [2017 dump](https://hotpotqa.github.io/wiki-readme.html)). We configure the LM and RM within DSPy, allowing DSPy to internally call the respective module when needed for generation or retrieval.
@@ -47,7 +47,7 @@ len(trainset), len(devset)
## Building Signatures
-Now that we have the data loaded, let's start defining the [signatures](/docs/building-blocks/2-signatures) for the sub-tasks of our pipeline.
+Now that we have the data loaded, let's start defining the [signatures](/docs/building-blocks/signatures) for the sub-tasks of our pipeline.
We can identify our simple input `question` and output `answer`, but since we are building out a RAG pipeline, we wish to utilize some contextual information from our ColBERT corpus. So let's define our signature: `context, question --> answer`.
@@ -64,7 +64,7 @@ We include small descriptions for the `context` and `answer` fields to define mo
## Building the Pipeline
-We will build our RAG pipeline as a [DSPy module](/docs/building-blocks/3-modules) which will require two methods:
+We will build our RAG pipeline as a [DSPy module](/docs/building-blocks/modules) which will require two methods:
* The `__init__` method will simply declare the sub-modules it needs: `dspy.Retrieve` and `dspy.ChainOfThought`. The latter is defined to implement our `GenerateAnswer` signature.
* The `forward` method will describe the control flow of answering the question using the modules we have: Given a question, we'll search for the top-3 relevant passages and then feed them as context for answer generation.
@@ -88,7 +88,7 @@ class RAG(dspy.Module):
##### Compiling the RAG program
-Having defined this program, let's now **compile** it. [Compiling a program](/docs/building-blocks/6-optimizers) will update the parameters stored in each module. In our setting, this is primarily in the form of collecting and selecting good demonstrations for inclusion within the prompt(s).
+Having defined this program, let's now **compile** it. [Compiling a program](/docs/building-blocks/optimizers) will update the parameters stored in each module. In our setting, this is primarily in the form of collecting and selecting good demonstrations for inclusion within the prompt(s).
Compiling depends on three things:
diff --git a/docs/tutorials/simplified-baleen.md b/docs/tutorials/simplified-baleen.md
index 5f4390bd0..5a78f5c0b 100644
--- a/docs/tutorials/simplified-baleen.md
+++ b/docs/tutorials/simplified-baleen.md
@@ -10,7 +10,7 @@ The standard approach for this challenge in retrieval-augmented NLP literature i
## Configuring LM and RM
-We'll start by setting up the language model (LM) and retrieval model (RM), which **DSPy** supports through multiple [LM](/docs/deep-dive/language_model_clients/remote_models/) and [RM](/docs/deep-dive/retrieval_models_clients/) APIs and [local models hosting](/docs/deep-dive/language_model_clients/local_models/).
+We'll start by setting up the language model (LM) and retrieval model (RM), which **DSPy** supports through multiple [LM](/docs/category/remote-language-model-clients) and [RM](/docs/category/retrieval-model-clients) APIs and [local models hosting](/docs/category/local-language-model-clients).
In this notebook, we'll work with GPT-3.5 (`gpt-3.5-turbo`) and the `ColBERTv2` retriever (a free server hosting a Wikipedia 2017 "abstracts" search index containing the first paragraph of each article from this [2017 dump](https://hotpotqa.github.io/wiki-readme.html)). We configure the LM and RM within DSPy, allowing DSPy to internally call the respective module when needed for generation or retrieval.