prompt stringlengths 131 11.8k | completion stringlengths 7 173 | api stringlengths 11 48 |
|---|---|---|
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.ColBERTv2 |
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.settings.configure(lm=turbo, trace=[], temperature=0.7) | 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.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.Retrieve(k=passages_per_hop) | dspy.Retrieve |
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.OutputField(desc="Yes or No") | dspy.OutputField |
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.HFClientTGI(model="meta-llama/Llama-2-13b-chat-hf", port=ports, max_tokens=150) | dspy.HFClientTGI |
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 |
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.InputField() | dspy.InputField |
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.settings.configure(rm=pys_ret_prebuilt) | dspy.settings.configure |
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) | dspy.OpenAI |
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... | HotPotQA(train_seed=1, train_size=20, eval_seed=2023, dev_size=50, test_size=0) | dspy.datasets.HotPotQA |
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.ChainOfThought(GenerateAnswer) | dspy.ChainOfThought |
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 |
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.InputField() | dspy.InputField |
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.OutputField(desc="often between 1 and 5 words") | 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.HFClientTGI(model="meta-llama/Llama-2-13b-chat-hf", port=[7140, 7141, 7142, 7143], max_tokens=150) | dspy.HFClientTGI |
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... | BootstrapFewShotWithRandomSearch(metric=gsm8k_metric, **config) | dspy.teleprompt.BootstrapFewShotWithRandomSearch |
import dspy
from dspy.evaluate import Evaluate
from dspy.datasets.gsm8k import GSM8K, gsm8k_metric
from dspy.teleprompt import BootstrapFewShotWithRandomSearch
gms8k = | GSM8K() | dspy.datasets.gsm8k.GSM8K |
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 |
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 -> answer') | dspy.ChainOfThought |
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... | dspy.ChainOfThought("question -> answer") | dspy.ChainOfThought |
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.Retrieve() | dspy.Retrieve |
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... | Evaluate(metric=metric, devset=devset, 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 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.evaluate.answer_exact_match_str(query, previous_queries, frac=0.8) | dspy.evaluate.answer_exact_match_str |
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.InputField(desc="may contain relevant facts") | dspy.InputField |
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.InputField() | 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.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.InputField(desc="may contain relevant facts") | dspy.InputField |
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... | InputField() | dspy.InputField |
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.ChainOfThought(GenerateCitedParagraph) | dspy.ChainOfThought |
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.ChainOfThought(GenerateSearchQuery) | dspy.ChainOfThought |
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.ChainOfThought(GenerateAnswer) | dspy.ChainOfThought |
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().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... | Evaluate(devset=devset[:1000], metric=metric_EM, num_threads=NUM_THREADS, display_progress=True, display_table=0) | dspy.evaluate.Evaluate |
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.Predict('question -> answer') | dspy.Predict |
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.ChainOfThought(GenerateSearchQuery) | dspy.ChainOfThought |
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.Prediction(context=context, answer=pred.answer) | dspy.Prediction |
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_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... | Evaluate(metric=metric, devset=devset, 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 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=passages_per_hop) | 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_passage_match(example, pred) | dspy.evaluate.answer_passage_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[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.Retrieve(k=3) | dspy.Retrieve |
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.OpenAI(model="gpt-3.5-turbo", max_tokens=4000) | 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... | dspy.InputField() | dspy.InputField |
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.settings.configure(rm=pys_ret_local) | 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.ChainOfThought("context, question -> answer") | dspy.ChainOfThought |
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.InputField(desc='ignore if N/A') | dspy.InputField |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.