Skip to content

Commit

Permalink
Other small fixes (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippeMoussalli authored Jan 9, 2024
1 parent dc221f3 commit f5a4b1c
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 12 deletions.
17 changes: 13 additions & 4 deletions src/evaluation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -407,10 +407,12 @@
"import os\n",
"import pipeline_eval\n",
"\n",
"os.environ[\"OPENAI_KEY\"] = \"\"\n",
"\n",
"evaluation_args = {\n",
" \"retrieval_top_k\": 2,\n",
" \"evaluation_module\": \"langchain.llms\",\n",
" \"evaluation_llm\": \"OpenAI\",\n",
" \"evaluation_module\": \"langchain.chat_models\",\n",
" \"evaluation_llm\": \"ChatOpenAI\",\n",
" \"evaluation_llm_kwargs\": {\"openai_api_key\": os.environ[\"OPENAI_KEY\"], \"model_name\" : \"gpt-3.5-turbo\"}, # TODO: Update with your key or use a different model\n",
" \"evaluation_metrics\": [\"context_precision\", \"context_relevancy\"]\n",
"}\n",
Expand All @@ -433,8 +435,15 @@
"source": [
"runner = DockerRunner()\n",
"extra_volumes = [str(os.path.join(os.path.abspath('.'), \"evaluation_datasets\")) + \":/data\"]\n",
"runner.run(evaluation_pipeline, extra_volumes=extra_volumes)\n",
"\n",
"runner.run(evaluation_pipeline, extra_volumes=extra_volumes)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"utils.store_results(evaluation_pipeline.name, **shared_args, **indexing_args)"
]
},
Expand Down
10 changes: 5 additions & 5 deletions src/parameter_search.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
"import weaviate\n",
"\n",
"try:\n",
" local_weaviate_client = weaviate.Client(\"http://localhost:8080\")\n",
" local_weaviate_client = weaviate.Client(\"http://localhost:8081\")\n",
" logging.info(\"Connected to Weaviate instance\")\n",
"except weaviate.WeaviateStartUpError:\n",
" logging.error(\"Cannot connect to weaviate instance, is it running?\")"
Expand Down Expand Up @@ -324,17 +324,17 @@
"\n",
"fixed_args = {\n",
" \"base_path\":BASE_PATH,\n",
" \"weaviate_url\":f\"http://{host_ip}:8080\", # IP address \n",
" \"weaviate_url\":f\"http://{host_ip}:8081\", # IP address \n",
"}\n",
"fixed_index_args = {\n",
" \"n_rows_to_load\":1000,\n",
"}\n",
"fixed_eval_args = {\n",
" \"csv_dataset_uri\":\"/data/wikitext_1000_q.csv\", #make sure it is the same as mounted file\n",
" \"csv_separator\":\";\",\n",
" \"evaluation_module\": \"langchain.llms\",\n",
" \"evaluation_llm\":\"OpenAI\",\n",
" \"evaluation_llm_kwargs\":{\"openai_api_key\": \"\"}, #TODO Specify your key if you're using OpenAI\n",
" \"evaluation_module\": \"langchain.chat_models\",\n",
" \"evaluation_llm\": \"ChatOpenAI\",\n",
" \"evaluation_llm_kwargs\": {\"openai_api_key\": os.environ[\"OPENAI_KEY\"], \"model_name\" : \"gpt-3.5-turbo\"}, # TODO: Update with your key or use a different model\n",
" \"evaluation_metrics\":[\"context_precision\", \"context_relevancy\"]\n",
"}"
]
Expand Down
3 changes: 2 additions & 1 deletion src/pipeline.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,8 @@
"source": [
"## Exploring the dataset\n",
"\n",
"You can also explore the dataset using the fondant explorer, this enables you to visualize your output dataset at each component step. It might take a while to start the first time as it needs to download the explorer docker image first."
"You can also explore the dataset using the fondant explorer, this enables you to visualize your output dataset at each component step. It might take a while to start the first time as it needs to download the explorer docker image first. You can browse at \n",
"http://localhost:8501/"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/pipeline_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

def create_pipeline(
*,
weaviate_url: str,
base_path: str = "./data-dir",
weaviate_url="http://host.docker.internal:8080",
weaviate_class: str = "Pipeline1",
csv_dataset_uri: str = "/data/wikitext_1000_q.csv",
csv_separator: str = ";",
Expand Down
2 changes: 1 addition & 1 deletion src/pipeline_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

def create_pipeline(
*,
weaviate_url: str,
base_path: str = "./data-dir",
n_rows_to_load: int = 1000,
weaviate_url: str = "http://host.docker.internal:8080",
weaviate_class: str = "Pipeline1",
weaviate_overwrite: bool = True,
embed_model_provider: str = "huggingface",
Expand Down

0 comments on commit f5a4b1c

Please sign in to comment.