Skip to content

Commit

Permalink
updated demo
Browse files Browse the repository at this point in the history
  • Loading branch information
daimor committed Feb 15, 2024
1 parent c7e2044 commit 17868e9
Showing 1 changed file with 34 additions and 46 deletions.
80 changes: 34 additions & 46 deletions demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -26,7 +26,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -42,7 +42,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -68,47 +68,34 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"2024.1-preview: Pulling from intersystems/iris-community\n",
"Digest: sha256:8d764a2b86f95180f7a34ef1f8a49e22892b0b22d48444d2c867718ef55da48c\n",
"Status: Image is up to date for containers.intersystems.com/intersystems/iris-community:2024.1-preview\n",
"containers.intersystems.com/intersystems/iris-community:2024.1-preview\n",
"\u001b[1m\n",
"What's Next?\n",
"\u001b[0m 1. Sign in to your Docker account → \u001b[36mdocker login\u001b[0m\n",
" 2. View a summary of image vulnerabilities and recommendations → \u001b[36mdocker scout quickview containers.intersystems.com/intersystems/iris-community:2024.1-preview\u001b[0m\n"
]
}
],
"outputs": [],
"source": [
"!docker pull containers.intersystems.com/intersystems/iris-community:2024.1-preview"
"!docker pull intersystemsdc/iris-community:2024.1-preview"
]
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Pulling image containers.intersystems.com/intersystems/iris-community:2024.1-preview\n",
"Container started: 86707c227611\n",
"Pulling image intersystemsdc/iris-community:2024.1-preview\n",
"Container started: 3b28b0550316\n",
"Waiting to be ready...\n",
"Waiting to be ready...\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Started iris://demo:demo@localhost:51122/demo\n"
"Started iris://demo:demo@localhost:61711/demo\n",
"Portal: http://localhost:61712/csp/sys/UtilHome.csp\n"
]
}
],
Expand All @@ -123,20 +110,22 @@
"\n",
"# Community Edition\n",
"license_key = None\n",
"image = 'containers.intersystems.com/intersystems/iris-community:2024.1-preview'\n",
"image = 'intersystemsdc/iris-community:2024.1-preview'\n",
"\n",
"container = IRISContainer(image, username=\"demo\", password=\"demo\", namespace=\"demo\", license_key=license_key)\n",
"container.with_exposed_ports(1972, 52773)\n",
"container.start()\n",
"CONNECTION_STRING = container.get_connection_url(\"localhost\")\n",
"\n",
"\n",
"time.sleep(1)\n",
"print('Started', CONNECTION_STRING)\n"
"print('Started', CONNECTION_STRING)\n",
"print('Portal: ', f\"http://localhost:{container.get_exposed_port(52773)}/csp/sys/UtilHome.csp\")\n"
]
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -152,7 +141,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -162,15 +151,15 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"--------------------------------------------------------------------------------\n",
"Score: 0.18465027104149012\n",
"Score: 0.184773936635373\n",
"Tonight. I call on the Senate to: Pass the Freedom to Vote Act. Pass the John Lewis Voting Rights Act. And while you’re at it, pass the Disclose Act so Americans can know who is funding our elections. \n",
"\n",
"Tonight, I’d like to honor someone who has dedicated his life to serve this country: Justice Stephen Breyer—an Army veteran, Constitutional scholar, and retiring Justice of the United States Supreme Court. Justice Breyer, thank you for your service. \n",
Expand All @@ -180,7 +169,7 @@
"And I did that 4 days ago, when I nominated Circuit Court of Appeals Judge Ketanji Brown Jackson. One of our nation’s top legal minds, who will continue Justice Breyer’s legacy of excellence.\n",
"--------------------------------------------------------------------------------\n",
"--------------------------------------------------------------------------------\n",
"Score: 0.21754558460960838\n",
"Score: 0.217491455113555\n",
"A former top litigator in private practice. A former federal public defender. And from a family of public school educators and police officers. A consensus builder. Since she’s been nominated, she’s received a broad range of support—from the Fraternal Order of Police to former judges appointed by Democrats and Republicans. \n",
"\n",
"And if we are to advance liberty and justice, we need to secure the Border and fix the immigration system. \n",
Expand All @@ -194,7 +183,7 @@
"We’re securing commitments and supporting partners in South and Central America to host more refugees and secure their own borders.\n",
"--------------------------------------------------------------------------------\n",
"--------------------------------------------------------------------------------\n",
"Score: 0.22691661118838602\n",
"Score: 0.226851860116283\n",
"And for our LGBTQ+ Americans, let’s finally get the bipartisan Equality Act to my desk. The onslaught of state laws targeting transgender Americans and their families is wrong. \n",
"\n",
"As I said last year, especially to our younger transgender Americans, I will always have your back as your President, so you can be yourself and reach your God-given potential. \n",
Expand All @@ -208,7 +197,7 @@
"First, beat the opioid epidemic.\n",
"--------------------------------------------------------------------------------\n",
"--------------------------------------------------------------------------------\n",
"Score: 0.22716985781299392\n",
"Score: 0.227250762767285\n",
"Tonight, I’m announcing a crackdown on these companies overcharging American businesses and consumers. \n",
"\n",
"And as Wall Street firms take over more nursing homes, quality in those homes has gone down and costs have gone up. \n",
Expand Down Expand Up @@ -238,7 +227,7 @@
},
{
"cell_type": "code",
"execution_count": 34,
"execution_count": 8,
"metadata": {},
"outputs": [
{
Expand All @@ -247,7 +236,7 @@
"(Document(page_content='foo'), 0.0)"
]
},
"execution_count": 34,
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -260,22 +249,21 @@
},
{
"cell_type": "code",
"execution_count": 35,
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[(Document(page_content='foo'), 0.0),\n",
" (Document(page_content='One was stationed at bases and breathing in toxic smoke from “burn pits” that incinerated wastes of war—medical and hazard material, jet fuel, and more. \\n\\nWhen they came home, many of the world’s fittest and best trained warriors were never the same. \\n\\nHeadaches. Numbness. Dizziness. \\n\\nA cancer that would put them in a flag-draped coffin. \\n\\nI know. \\n\\nOne of those soldiers was my son Major Beau Biden. \\n\\nWe don’t know for sure if a burn pit was the cause of his brain cancer, or the diseases of so many of our troops. \\n\\nBut I’m committed to finding out everything we can. \\n\\nCommitted to military families like Danielle Robinson from Ohio. \\n\\nThe widow of Sergeant First Class Heath Robinson. \\n\\nHe was born a soldier. Army National Guard. Combat medic in Kosovo and Iraq. \\n\\nStationed near Baghdad, just yards from burn pits the size of football fields. \\n\\nHeath’s widow Danielle is here with us tonight. They loved going to Ohio State football games. He loved building Legos with their daughter.', metadata={'source': 'state_of_the_union.txt'}),\n",
" 0.24031313511070396),\n",
" (Document(page_content='And let’s pass the PRO Act when a majority of workers want to form a union—they shouldn’t be stopped. \\n\\nWhen we invest in our workers, when we build the economy from the bottom up and the middle out together, we can do something we haven’t done in a long time: build a better America. \\n\\nFor more than two years, COVID-19 has impacted every decision in our lives and the life of the nation. \\n\\nAnd I know you’re tired, frustrated, and exhausted. \\n\\nBut I also know this. \\n\\nBecause of the progress we’ve made, because of your resilience and the tools we have, tonight I can say \\nwe are moving forward safely, back to more normal routines. \\n\\nWe’ve reached a new moment in the fight against COVID-19, with severe cases down to a level not seen since last July. \\n\\nJust a few days ago, the Centers for Disease Control and Prevention—the CDC—issued new mask guidelines. \\n\\nUnder these new guidelines, most Americans in most of the country can now be mask free.', metadata={'source': 'state_of_the_union.txt'}),\n",
" 0.24034585006541898),\n",
" (Document(page_content='foo'), 0.0),\n",
" (Document(page_content='A former top litigator in private practice. A former federal public defender. And from a family of public school educators and police officers. A consensus builder. Since she’s been nominated, she’s received a broad range of support—from the Fraternal Order of Police to former judges appointed by Democrats and Republicans. \\n\\nAnd if we are to advance liberty and justice, we need to secure the Border and fix the immigration system. \\n\\nWe can do both. At our border, we’ve installed new technology like cutting-edge scanners to better detect drug smuggling. \\n\\nWe’ve set up joint patrols with Mexico and Guatemala to catch more human traffickers. \\n\\nWe’re putting in place dedicated immigration judges so families fleeing persecution and violence can have their cases heard faster. \\n\\nWe’re securing commitments and supporting partners in South and Central America to host more refugees and secure their own borders.', metadata={'source': 'state_of_the_union.txt'}),\n",
" 0.2404426456007971)]"
" 0.241218341760677),\n",
" (Document(page_content='And let’s pass the PRO Act when a majority of workers want to form a union—they shouldn’t be stopped. \\n\\nWhen we invest in our workers, when we build the economy from the bottom up and the middle out together, we can do something we haven’t done in a long time: build a better America. \\n\\nFor more than two years, COVID-19 has impacted every decision in our lives and the life of the nation. \\n\\nAnd I know you’re tired, frustrated, and exhausted. \\n\\nBut I also know this. \\n\\nBecause of the progress we’ve made, because of your resilience and the tools we have, tonight I can say \\nwe are moving forward safely, back to more normal routines. \\n\\nWe’ve reached a new moment in the fight against COVID-19, with severe cases down to a level not seen since last July. \\n\\nJust a few days ago, the Centers for Disease Control and Prevention—the CDC—issued new mask guidelines. \\n\\nUnder these new guidelines, most Americans in most of the country can now be mask free.', metadata={'source': 'state_of_the_union.txt'}),\n",
" 0.241445435754669)]"
]
},
"execution_count": 35,
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -286,14 +274,14 @@
},
{
"cell_type": "code",
"execution_count": 38,
"execution_count": 10,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"tags=['IRISVector'] vectorstore=<langchain_iris.vectorstores.IRISVector object at 0x16984e390>\n"
"tags=['IRISVector'] vectorstore=<langchain_iris.vectorstores.IRISVector object at 0x13faf9b90>\n"
]
}
],
Expand All @@ -304,7 +292,7 @@
},
{
"cell_type": "code",
"execution_count": 37,
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
Expand Down

0 comments on commit 17868e9

Please sign in to comment.