prompt stringlengths 131 11.8k | completion stringlengths 7 173 | api stringlengths 11 48 |
|---|---|---|
get_ipython().run_line_magic('load_ext', 'autoreload')
get_ipython().run_line_magic('autoreload', '2')
import dspy
from dspy.evaluate import Evaluate
from dspy.datasets.hotpotqa import HotPotQA
from dspy.teleprompt import BootstrapFewShotWithRandomSearch, BootstrapFinetune
ports = [7140, 7141, 7142, 7143, 7144, 71... | dspy.Example(question=x.question) | dspy.Example |
get_ipython().system('pip install clarifai')
get_ipython().system('pip install dspy-ai')
import dspy
from dspy.retrieve.clarifai_rm import ClarifaiRM
MODEL_URL = "https://clarifai.com/meta/Llama-2/models/llama2-70b-chat"
PAT = "CLARIFAI_PAT"
USER_ID = "YOUR_ID"
APP_ID = "YOUR_APP"
from langchain.text_spli... | dspy.settings.configure(lm=gemini_lm, rm=retriever_model) | dspy.settings.configure |
get_ipython().run_line_magic('load_ext', 'autoreload')
get_ipython().run_line_magic('autoreload', '2')
import sys
import os
try: # When on google Colab, let's clone the notebook so we download the cache.
import google.colab
repo_path = 'dspy'
get_ipython().system('git -C $repo_path pull origin || git clon... | Evaluate(devset=dev, metric=metric_EM, num_threads=NUM_THREADS, display_progress=True, display_table=15) | dspy.evaluate.Evaluate |
import dspy
from dsp.utils import deduplicate
from dspy.datasets import HotPotQA
from dspy.predict.retry import Retry
from dspy.teleprompt import BootstrapFewShot, BootstrapFewShotWithRandomSearch
from dspy.evaluate.evaluate import Evaluate
from dspy.primitives.assertions import assert_transform_module, backtrack_hand... | dspy.settings.configure(lm=turbo, trace=[], temperature=0.7) | dspy.settings.configure |
get_ipython().system('git clone https://huggingface.co/arnavs11/DSPy_TweetGen_Cache')
get_ipython().run_line_magic('cd', 'DSPy_TweetGen_Cache/')
get_ipython().system('git checkout master')
get_ipython().run_line_magic('cd', '..')
import os
repo_clone_path = '/content/DSPy_TweetGen_Cache'
if not os.access('/content', o... | dspy.Predict(AssessTweet) | dspy.Predict |
get_ipython().system('git clone https://huggingface.co/arnavs11/DSPy_TweetGen_Cache')
get_ipython().run_line_magic('cd', 'DSPy_TweetGen_Cache/')
get_ipython().system('git checkout master')
get_ipython().run_line_magic('cd', '..')
import os
repo_clone_path = '/content/DSPy_TweetGen_Cache'
if not os.access('/content', o... | dspy.Predict(AssessTweet) | dspy.Predict |
get_ipython().system('pip install clarifai')
get_ipython().system('pip install dspy-ai')
import dspy
from dspy.retrieve.clarifai_rm import ClarifaiRM
MODEL_URL = "https://clarifai.com/meta/Llama-2/models/llama2-70b-chat"
PAT = "CLARIFAI_PAT"
USER_ID = "YOUR_ID"
APP_ID = "YOUR_APP"
from langchain.text_spli... | dspy.InputField(desc="User query") | dspy.InputField |
get_ipython().system('git clone https://huggingface.co/arnavs11/DSPy_TweetGen_Cache')
get_ipython().run_line_magic('cd', 'DSPy_TweetGen_Cache/')
get_ipython().system('git checkout master')
get_ipython().run_line_magic('cd', '..')
import os
repo_clone_path = '/content/DSPy_TweetGen_Cache'
if not os.access('/content', o... | dspy.OpenAI(model='gpt-3.5-turbo', max_tokens=500) | dspy.OpenAI |
get_ipython().run_line_magic('load_ext', 'autoreload')
get_ipython().run_line_magic('autoreload', '2')
import sys
import pkg_resources
try: # When on Colab, let's install pyserini, Pytorch, and Faiss
import google.colab
repo_path = 'dspy'
get_ipython().system('git -C $repo_path pull origin || git clone h... | dspy.Pyserini(index='indexes/faiss.nfcorpus.contriever-msmarco', query_encoder='facebook/contriever-msmarco', dataset=dataset, id_field='_id', text_fields=['title', 'text']) | dspy.Pyserini |
import dspy
from dspy.evaluate import Evaluate
from dspy.datasets.gsm8k import GSM8K, gsm8k_metric
from dspy.teleprompt import BootstrapFewShotWithRandomSearch
gms8k = GSM8K()
turbo = dspy.OpenAI(model='gpt-3.5-turbo-instruct', max_tokens=250)
trainset, devset = gms8k.train, gms8k.dev
dspy.settings.configure(lm=tur... | Evaluate(devset=devset[:], metric=gsm8k_metric, num_threads=NUM_THREADS, display_progress=True, display_table=0) | dspy.evaluate.Evaluate |
get_ipython().system('git clone https://huggingface.co/arnavs11/DSPy_TweetGen_Cache')
get_ipython().run_line_magic('cd', 'DSPy_TweetGen_Cache/')
get_ipython().system('git checkout master')
get_ipython().run_line_magic('cd', '..')
import os
repo_clone_path = '/content/DSPy_TweetGen_Cache'
if not os.access('/content', o... | dspy.Predict(AssessTweet) | dspy.Predict |
import dspy
from dsp.utils import deduplicate
from dspy.datasets import HotPotQA
from dspy.predict.retry import Retry
from dspy.teleprompt import BootstrapFewShot, BootstrapFewShotWithRandomSearch
from dspy.evaluate.evaluate import Evaluate
from dspy.primitives.assertions import assert_transform_module, backtrack_hand... | HotPotQA(train_seed=1, train_size=300, eval_seed=2023, dev_size=300, test_size=0) | dspy.datasets.HotPotQA |
import dspy
from dspy.evaluate.evaluate import Evaluate
from dspy.teleprompt import BootstrapFewShotWithRandomSearch
colbertv2 = dspy.ColBERTv2(url='http://20.102.90.50:2017/wiki17_abstracts')
| dspy.configure(rm=colbertv2) | dspy.configure |
get_ipython().system('git clone https://huggingface.co/arnavs11/DSPy_TweetGen_Cache')
get_ipython().run_line_magic('cd', 'DSPy_TweetGen_Cache/')
get_ipython().system('git checkout master')
get_ipython().run_line_magic('cd', '..')
import os
repo_clone_path = '/content/DSPy_TweetGen_Cache'
if not os.access('/content', o... | Evaluate(metric=metric, devset=devset[10:11], num_threads=1, display_progress=True, display_table=5) | dspy.evaluate.evaluate.Evaluate |
get_ipython().run_line_magic('load_ext', 'autoreload')
get_ipython().run_line_magic('autoreload', '2')
import sys
import pkg_resources
try: # When on Colab, let's install pyserini, Pytorch, and Faiss
import google.colab
repo_path = 'dspy'
get_ipython().system('git -C $repo_path pull origin || git clone h... | dspy.Pyserini(index='beir-v1.0.0-nfcorpus.contriever-msmarco', query_encoder='facebook/contriever-msmarco', id_field='_id', text_fields=['title', 'text']) | dspy.Pyserini |
import dspy
from dspy.evaluate.evaluate import Evaluate
from dspy.teleprompt import BootstrapFewShotWithRandomSearch
colbertv2 = dspy.ColBERTv2(url='http://20.102.90.50:2017/wiki17_abstracts')
dspy.configure(rm=colbertv2)
from langchain_openai import OpenAI
from langchain.globals import set_llm_cache
from langcha... | LangChainModule(zeroshot_chain) | dspy.predict.langchain.LangChainModule |
import dspy
from dsp.utils import deduplicate
from dspy.datasets import HotPotQA
from dspy.predict.retry import Retry
from dspy.teleprompt import BootstrapFewShot, BootstrapFewShotWithRandomSearch
from dspy.evaluate.evaluate import Evaluate
from dspy.primitives.assertions import assert_transform_module, backtrack_hand... | dspy.OpenAI(model='gpt-3.5-turbo', max_tokens=500) | dspy.OpenAI |
import dspy
from dsp.utils import deduplicate
from dspy.datasets import HotPotQA
from dspy.predict.retry import Retry
from dspy.teleprompt import BootstrapFewShot, BootstrapFewShotWithRandomSearch
from dspy.evaluate.evaluate import Evaluate
from dspy.primitives.assertions import assert_transform_module, backtrack_hand... | dspy.Prediction(context=context, answer=pred.answer) | dspy.Prediction |
get_ipython().system('git clone https://huggingface.co/arnavs11/DSPy_QuizGen_Cache')
get_ipython().run_line_magic('cd', 'DSPy_QuizGen_Cache/')
get_ipython().system('git checkout master')
get_ipython().run_line_magic('cd', '..')
import os
repo_clone_path = '/content/DSPy_QuizGen_Cache'
if not os.access('/content', os.W... | dspy.ColBERTv2(url='http://20.102.90.50:2017/wiki17_abstracts') | dspy.ColBERTv2 |
get_ipython().system('git clone https://huggingface.co/arnavs11/DSPy_LongFormQA_Cache')
get_ipython().run_line_magic('cd', 'DSPy_LongFormQA_Cache/')
get_ipython().system('git checkout master')
get_ipython().run_line_magic('cd', '..')
import os
repo_clone_path = '/content/DSPy_LongFormQA_Cache'
if not os.access('/conte... | dspy.ColBERTv2(url='http://20.102.90.50:2017/wiki17_abstracts') | dspy.ColBERTv2 |
get_ipython().run_line_magic('load_ext', 'autoreload')
get_ipython().run_line_magic('autoreload', '2')
get_ipython().run_line_magic('pip', 'install datasets')
import datasets
ds = datasets.load_dataset("openai_humaneval")
ds['test'][0]
import dspy, dotenv, os
dotenv.load_dotenv(os.path.expanduser("~/.env")) # lo... | dspy.settings.configure(lm=lm) | dspy.settings.configure |
get_ipython().run_line_magic('load_ext', 'autoreload')
get_ipython().run_line_magic('autoreload', '2')
import sys
import os
try: # When on google Colab, let's clone the notebook so we download the cache.
import google.colab
repo_path = 'dspy'
get_ipython().system('git -C $repo_path pull origin || git clon... | dspy.evaluate.answer_passage_match(example, pred) | dspy.evaluate.answer_passage_match |
get_ipython().system('git clone https://huggingface.co/arnavs11/DSPy_QuizGen_Cache')
get_ipython().run_line_magic('cd', 'DSPy_QuizGen_Cache/')
get_ipython().system('git checkout master')
get_ipython().run_line_magic('cd', '..')
import os
repo_clone_path = '/content/DSPy_QuizGen_Cache'
if not os.access('/content', os.W... | dspy.OpenAI(model='gpt-3.5-turbo', max_tokens=500) | dspy.OpenAI |
get_ipython().system('git clone https://huggingface.co/arnavs11/DSPy_LongFormQA_Cache')
get_ipython().run_line_magic('cd', 'DSPy_LongFormQA_Cache/')
get_ipython().system('git checkout master')
get_ipython().run_line_magic('cd', '..')
import os
repo_clone_path = '/content/DSPy_LongFormQA_Cache'
if not os.access('/conte... | BootstrapFewShotWithRandomSearch(metric = answer_correctness, max_bootstrapped_demos=2, num_candidate_programs=6) | dspy.teleprompt.BootstrapFewShotWithRandomSearch |
import dspy
from dsp.utils import deduplicate
from dspy.datasets import HotPotQA
from dspy.predict.retry import Retry
from dspy.teleprompt import BootstrapFewShot, BootstrapFewShotWithRandomSearch
from dspy.evaluate.evaluate import Evaluate
from dspy.primitives.assertions import assert_transform_module, backtrack_hand... | dspy.ColBERTv2(url='http://20.102.90.50:2017/wiki17_abstracts') | dspy.ColBERTv2 |
get_ipython().system('git clone https://huggingface.co/arnavs11/DSPy_LongFormQA_Cache')
get_ipython().run_line_magic('cd', 'DSPy_LongFormQA_Cache/')
get_ipython().system('git checkout master')
get_ipython().run_line_magic('cd', '..')
import os
repo_clone_path = '/content/DSPy_LongFormQA_Cache'
if not os.access('/conte... | dspy.OpenAI(model='gpt-3.5-turbo', max_tokens=500) | dspy.OpenAI |
get_ipython().system('pip install clarifai')
get_ipython().system('pip install dspy-ai')
import dspy
from dspy.retrieve.clarifai_rm import ClarifaiRM
MODEL_URL = "https://clarifai.com/meta/Llama-2/models/llama2-70b-chat"
PAT = "CLARIFAI_PAT"
USER_ID = "YOUR_ID"
APP_ID = "YOUR_APP"
from langchain.text_spli... | dspy.Clarifai(model="https://clarifai.com/gcp/generate/models/gemini-pro", api_key=PAT, n=2) | dspy.Clarifai |
import dspy
from dspy.evaluate.evaluate import Evaluate
from dspy.teleprompt import BootstrapFewShotWithRandomSearch
colbertv2 = dspy.ColBERTv2(url='http://20.102.90.50:2017/wiki17_abstracts')
dspy.configure(rm=colbertv2)
from langchain_openai import OpenAI
from langchain.globals import set_llm_cache
from langcha... | BootstrapFewShotWithRandomSearch(metric=metric, max_bootstrapped_demos=3, num_candidate_programs=3) | dspy.teleprompt.BootstrapFewShotWithRandomSearch |
get_ipython().system('pip install clarifai')
get_ipython().system('pip install dspy-ai')
import dspy
from dspy.retrieve.clarifai_rm import ClarifaiRM
MODEL_URL = "https://clarifai.com/meta/Llama-2/models/llama2-70b-chat"
PAT = "CLARIFAI_PAT"
USER_ID = "YOUR_ID"
APP_ID = "YOUR_APP"
from langchain.text_spli... | dspy.OutputField(desc="Answer in one or two lines") | dspy.OutputField |
get_ipython().system('git clone https://huggingface.co/arnavs11/DSPy_LongFormQA_Cache')
get_ipython().run_line_magic('cd', 'DSPy_LongFormQA_Cache/')
get_ipython().system('git checkout master')
get_ipython().run_line_magic('cd', '..')
import os
repo_clone_path = '/content/DSPy_LongFormQA_Cache'
if not os.access('/conte... | BootstrapFewShotWithRandomSearch(metric = answer_correctness, max_bootstrapped_demos=2, num_candidate_programs=6) | dspy.teleprompt.BootstrapFewShotWithRandomSearch |
get_ipython().system('git clone https://huggingface.co/arnavs11/DSPy_LongFormQA_Cache')
get_ipython().run_line_magic('cd', 'DSPy_LongFormQA_Cache/')
get_ipython().system('git checkout master')
get_ipython().run_line_magic('cd', '..')
import os
repo_clone_path = '/content/DSPy_LongFormQA_Cache'
if not os.access('/conte... | dspy.OutputField(desc="includes citations") | dspy.OutputField |
get_ipython().run_line_magic('load_ext', 'autoreload')
get_ipython().run_line_magic('autoreload', '2')
import sys
import os
try: # When on google Colab, let's clone the notebook so we download the cache.
import google.colab
repo_path = 'dspy'
get_ipython().system('git -C $repo_path pull origin || git clon... | dspy.ChainOfThought("question -> search_query") | dspy.ChainOfThought |
get_ipython().system('git clone https://huggingface.co/arnavs11/DSPy_LongFormQA_Cache')
get_ipython().run_line_magic('cd', 'DSPy_LongFormQA_Cache/')
get_ipython().system('git checkout master')
get_ipython().run_line_magic('cd', '..')
import os
repo_clone_path = '/content/DSPy_LongFormQA_Cache'
if not os.access('/conte... | dspy.Retrieve(k=passages_per_hop) | dspy.Retrieve |
import glob
import os
import pandas as pd
import random
import dspy
from dspy.evaluate import Evaluate
from dspy.teleprompt import BootstrapFewShotWithRandomSearch
os.environ["DSP_NOTEBOOK_CACHEDIR"] = os.path.join('.', 'cache')
turbo = dspy.OpenAI(model='gpt-3.5-turbo-1106', max_tokens=250, model_type='chat')
d... | dspy.OutputField(desc="Yes or No") | dspy.OutputField |
get_ipython().run_line_magic('load_ext', 'autoreload')
get_ipython().run_line_magic('autoreload', '2')
import sys
import os
try: # When on google Colab, let's clone the notebook so we download the cache.
import google.colab
repo_path = 'dspy'
get_ipython().system('git -C $repo_path pull origin || git clon... | dspy.Retrieve(k=num_passages) | dspy.Retrieve |
import dspy
from dsp.utils import deduplicate
from dspy.datasets import HotPotQA
from dspy.predict.retry import Retry
from dspy.teleprompt import BootstrapFewShot, BootstrapFewShotWithRandomSearch
from dspy.evaluate.evaluate import Evaluate
from dspy.primitives.assertions import assert_transform_module, backtrack_hand... | dspy.evaluate.answer_exact_match(example, pred) | dspy.evaluate.answer_exact_match |
get_ipython().system('git clone https://huggingface.co/arnavs11/DSPy_TweetGen_Cache')
get_ipython().run_line_magic('cd', 'DSPy_TweetGen_Cache/')
get_ipython().system('git checkout master')
get_ipython().run_line_magic('cd', '..')
import os
repo_clone_path = '/content/DSPy_TweetGen_Cache'
if not os.access('/content', o... | Evaluate(metric=metric, devset=devset, num_threads=1, display_progress=True, display_table=5) | dspy.evaluate.evaluate.Evaluate |
import dspy
from dspy.evaluate.evaluate import Evaluate
from dspy.teleprompt import BootstrapFewShotWithRandomSearch
colbertv2 = dspy.ColBERTv2(url='http://20.102.90.50:2017/wiki17_abstracts')
dspy.configure(rm=colbertv2)
from langchain_openai import OpenAI
from langchain.globals import set_llm_cache
from langcha... | LangChainPredict(prompt, llm) | dspy.predict.langchain.LangChainPredict |
get_ipython().run_line_magic('load_ext', 'autoreload')
get_ipython().run_line_magic('autoreload', '2')
import sys
import os
try: # When on google Colab, let's clone the notebook so we download the cache.
import google.colab
repo_path = 'dspy'
get_ipython().system('git -C $repo_path pull origin || git clon... | dspy.HFClientTGI(model="meta-llama/Llama-2-13b-chat-hf", port=[7140, 7141, 7142, 7143], max_tokens=150) | dspy.HFClientTGI |
import dspy
from dsp.utils import deduplicate
from dspy.datasets import HotPotQA
from dspy.predict.retry import Retry
from dspy.teleprompt import BootstrapFewShot, BootstrapFewShotWithRandomSearch
from dspy.evaluate.evaluate import Evaluate
from dspy.primitives.assertions import assert_transform_module, backtrack_hand... | Evaluate(devset=devset, num_threads=10, display_progress=True, display_table=False) | dspy.evaluate.evaluate.Evaluate |
get_ipython().run_line_magic('load_ext', 'autoreload')
get_ipython().run_line_magic('autoreload', '2')
import dspy
from dspy.evaluate import Evaluate
from dspy.datasets.hotpotqa import HotPotQA
from dspy.teleprompt import BootstrapFewShotWithRandomSearch, BootstrapFinetune
ports = [7140, 7141, 7142, 7143, 7144, 71... | HotPotQA(train_seed=1, train_size=3000, eval_seed=2023, dev_size=0, test_size=0) | dspy.datasets.hotpotqa.HotPotQA |
get_ipython().system('git clone https://huggingface.co/arnavs11/DSPy_TweetGen_Cache')
get_ipython().run_line_magic('cd', 'DSPy_TweetGen_Cache/')
get_ipython().system('git checkout master')
get_ipython().run_line_magic('cd', '..')
import os
repo_clone_path = '/content/DSPy_TweetGen_Cache'
if not os.access('/content', o... | Evaluate(metric=metric, devset=devset, num_threads=1, display_progress=True, display_table=5) | dspy.evaluate.evaluate.Evaluate |
get_ipython().system('git clone https://huggingface.co/arnavs11/DSPy_TweetGen_Cache')
get_ipython().run_line_magic('cd', 'DSPy_TweetGen_Cache/')
get_ipython().system('git checkout master')
get_ipython().run_line_magic('cd', '..')
import os
repo_clone_path = '/content/DSPy_TweetGen_Cache'
if not os.access('/content', o... | HotPotQA(train_seed=1, train_size=300, eval_seed=2023, dev_size=300, test_size=0, keep_details=True) | dspy.datasets.HotPotQA |
get_ipython().run_line_magic('load_ext', 'autoreload')
get_ipython().run_line_magic('autoreload', '2')
import sys
import os
try: # When on google Colab, let's clone the notebook so we download the cache.
import google.colab
repo_path = 'dspy'
get_ipython().system('git -C $repo_path pull origin || git clon... | dspy.Example(question=question, answer=answer) | dspy.Example |
import dspy
from dsp.utils import deduplicate
from dspy.datasets import HotPotQA
from dspy.predict.retry import Retry
from dspy.teleprompt import BootstrapFewShot, BootstrapFewShotWithRandomSearch
from dspy.evaluate.evaluate import Evaluate
from dspy.primitives.assertions import assert_transform_module, backtrack_hand... | dspy.OutputField() | dspy.OutputField |
get_ipython().system('git clone https://huggingface.co/arnavs11/DSPy_LongFormQA_Cache')
get_ipython().run_line_magic('cd', 'DSPy_LongFormQA_Cache/')
get_ipython().system('git checkout master')
get_ipython().run_line_magic('cd', '..')
import os
repo_clone_path = '/content/DSPy_LongFormQA_Cache'
if not os.access('/conte... | BootstrapFewShotWithRandomSearch(metric = answer_correctness, max_bootstrapped_demos=2, num_candidate_programs=6) | dspy.teleprompt.BootstrapFewShotWithRandomSearch |
get_ipython().run_line_magic('load_ext', 'autoreload')
get_ipython().run_line_magic('autoreload', '2')
import sys
import os
try: # When on google Colab, let's clone the notebook so we download the cache.
import google.colab
repo_path = 'dspy'
get_ipython().system('git -C $repo_path pull origin || git clon... | dspy.ChainOfThought("context, question -> answer") | dspy.ChainOfThought |
get_ipython().run_line_magic('load_ext', 'autoreload')
get_ipython().run_line_magic('autoreload', '2')
import dspy
from dspy.evaluate import Evaluate
from dspy.datasets.hotpotqa import HotPotQA
from dspy.teleprompt import BootstrapFewShotWithRandomSearch, BootstrapFinetune
ports = [7140, 7141, 7142, 7143, 7144, 71... | dspy.HFModel(checkpoint=ckpt_path, model='t5-large') | dspy.HFModel |
get_ipython().system('git clone https://huggingface.co/arnavs11/DSPy_TweetGen_Cache')
get_ipython().run_line_magic('cd', 'DSPy_TweetGen_Cache/')
get_ipython().system('git checkout master')
get_ipython().run_line_magic('cd', '..')
import os
repo_clone_path = '/content/DSPy_TweetGen_Cache'
if not os.access('/content', o... | dspy.Prediction(generated_tweet=generated_tweet, context=context) | dspy.Prediction |
get_ipython().run_line_magic('load_ext', 'autoreload')
get_ipython().run_line_magic('autoreload', '2')
import sys
import os
try: # When on google Colab, let's clone the notebook so we download the cache.
import google.colab
repo_path = 'dspy'
get_ipython().system('git -C $repo_path pull origin || git clon... | dspy.settings.configure(rm=colbertv2, lm=llama) | dspy.settings.configure |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 10