Skip to content

Commit

Permalink
update sample_qa
Browse files Browse the repository at this point in the history
  • Loading branch information
Yongtae723 committed Oct 10, 2023
1 parent e4eabf5 commit 672e13d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 0 additions & 1 deletion llmflowoptimizer/component/model/sample_qa.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ def __init__(
self.text_splitter = text_splitter
self.text_loader = TextLoader(data_path)
self.llm = llm
# embedding should not be on __init__ for testing, because it call embedding function and it might need api-key.
self.index = VectorstoreIndexCreator(
embedding=self.embedding, text_splitter=self.text_splitter
).from_loaders([self.text_loader])
Expand Down
12 changes: 7 additions & 5 deletions notebooks/LLMFlowOptimizer_tutorial_notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# This is tutorial notebook for LLMFlowOptimizer\n",
"# This is colab tutorial notebook for LLMFlowOptimizer\n",
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Yongtae723/LLMFlowOptimizer/blob/main/notebooks/LLMFlowOptimizer_tutorial_notebook.ipynb)\n",
"\n",
"LLMFlowOptimizer is made for treating component of LLMFlow as parameter and optimizing the parameters.\n",
"\n",
"\n",
"![concept_image](https://github.com/Yongtae723/LLMFlowOptimizer/blob/main/documents/image/concept.png?raw=true)\n",
"\n",
"We assume LLMFlowOptimizer is used as repository scale, but you can experience flow and concept of LLMFlowOptimizer in this notebook. "
Expand Down Expand Up @@ -101,7 +104,6 @@
" self.text_splitter = text_splitter\n",
" self.text_loader = TextLoader(data_path)\n",
" self.llm = llm\n",
" # embedding should not be on __init__ for testing, because it call embedding function and it might need api-key.\n",
" self.index = VectorstoreIndexCreator(\n",
" embedding=self.embedding, text_splitter=self.text_splitter\n",
" ).from_loaders([self.text_loader])\n",
Expand Down Expand Up @@ -221,7 +223,7 @@
"\n",
"\n",
"def load_hydra_config():\n",
" with initialize(version_base=\"1.3\", config_path=\"../configs\"):\n",
" with initialize(version_base=\"1.3\", config_path=\"configs\"):\n",
" cfg = compose(config_name=\"run.yaml\", return_hydra_config=True, overrides=[])\n",
" with open_dict(cfg):\n",
" cfg.paths.root = str(rootutils.find_root(indicator=\".project-root\"))\n",
Expand Down Expand Up @@ -451,8 +453,8 @@
"source": [
"# If you like this project💖\n",
"\n",
"if you like this project, you can use this project as a template for your own project.\n",
"Push `Use this template` button on the top of this repo, then you can create your own project based on this project."
"if you like this project, you can use [this project](https://github.com/Yongtae723/LLMFlowOptimizer/blob/main/notebooks/tutorial_notebook.ipynb) as a template for your own project.\n",
"Push `Use this template` button on the top of [this repo](https://github.com/Yongtae723/LLMFlowOptimizer/blob/main/notebooks/tutorial_notebook.ipynb), then you can create your own project based on this project."
]
},
{
Expand Down

0 comments on commit 672e13d

Please sign in to comment.