Skip to content

armgit / dspy

Public Imported from GitHub
0

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

Python

Update compiler notebook

Omar Khattabbfe7c9235321
diff --git a/compiler.ipynb b/compiler.ipynb
index 1a871f03c..e02b52b9b 100644
--- a/compiler.ipynb
+++ b/compiler.ipynb
@@ -183,7 +183,13 @@
}
],
"source": [
- "with open('data/multihop_800_unlabeled_questions.json') as f:\n",
+ "try: # When on google Colab, the path is slightly different.\n",
+ " import google.colab\n",
+ " unlabeled_questions_path = 'dsp/data/multihop_800_unlabeled_questions.json'\n",
+ "except:\n",
+ " unlabeled_questions_path = 'data/multihop_800_unlabeled_questions.json'\n",
+ "\n",
+ "with open(unlabeled_questions_path) as f:\n",
" multihop_800_unlabeled_questions = ujson.loads(f.readline())\n",
"\n",
"multihop_800_unlabeled_questions = [example['question'] for example in multihop_800_unlabeled_questions]\n",