mirror of
https://github.com/james-m-jordan/openai-cookbook.git
synced 2025-05-09 19:32:38 +00:00
Merge pull request #424 from jamescalam/gpt-4-example-fix
added data creation loop
This commit is contained in:
commit
b90f835fbe
@ -203,6 +203,29 @@
|
|||||||
"docs[5].metadata['source'].replace('rtdocs/', 'https://')"
|
"docs[5].metadata['source'].replace('rtdocs/', 'https://')"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"attachments": {},
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"We can use these to create our `data` list:"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"data = []\n",
|
||||||
|
"\n",
|
||||||
|
"for doc in docs:\n",
|
||||||
|
" data.append({\n",
|
||||||
|
" 'url': doc.metadata['source'].replace('rtdocs/', 'https://'),\n",
|
||||||
|
" 'text': doc.page_content\n",
|
||||||
|
" })"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 60,
|
"execution_count": 60,
|
||||||
@ -280,6 +303,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"attachments": {},
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"id": "bLdvW8eq06Zd"
|
"id": "bLdvW8eq06Zd"
|
||||||
@ -345,6 +369,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"attachments": {},
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"id": "JegURaAg2PuN"
|
"id": "JegURaAg2PuN"
|
||||||
@ -354,6 +379,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"attachments": {},
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"id": "zGIZbQqJ2WBh"
|
"id": "zGIZbQqJ2WBh"
|
||||||
@ -388,6 +414,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"attachments": {},
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"id": "aNZ7IWekNLbu"
|
"id": "aNZ7IWekNLbu"
|
||||||
@ -423,6 +450,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"attachments": {},
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"id": "zStnHFpkNVIU"
|
"id": "zStnHFpkNVIU"
|
||||||
@ -484,6 +512,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"attachments": {},
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"id": "XPd41MjANhmp"
|
"id": "XPd41MjANhmp"
|
||||||
@ -493,6 +522,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"attachments": {},
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"id": "WPi4MZvMNvUH"
|
"id": "WPi4MZvMNvUH"
|
||||||
@ -502,6 +532,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"attachments": {},
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"id": "H5RRQArrN2lN"
|
"id": "H5RRQArrN2lN"
|
||||||
@ -561,6 +592,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"attachments": {},
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"id": "ezSTzN2rPa2o"
|
"id": "ezSTzN2rPa2o"
|
||||||
@ -649,6 +681,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"attachments": {},
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"id": "YttJOrEtQIF9"
|
"id": "YttJOrEtQIF9"
|
||||||
@ -658,6 +691,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"attachments": {},
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"id": "FumVmMRlQQ7w"
|
"id": "FumVmMRlQQ7w"
|
||||||
@ -667,6 +701,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"attachments": {},
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"id": "nLRODeL-QTJ9"
|
"id": "nLRODeL-QTJ9"
|
||||||
@ -892,6 +927,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"attachments": {},
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"id": "MoBSiDLIUADZ"
|
"id": "MoBSiDLIUADZ"
|
||||||
@ -901,6 +937,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"attachments": {},
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"id": "qfzS4-6-UXgX"
|
"id": "qfzS4-6-UXgX"
|
||||||
@ -910,6 +947,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"attachments": {},
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"id": "XPC1jQaKUcy0"
|
"id": "XPC1jQaKUcy0"
|
||||||
@ -976,6 +1014,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"attachments": {},
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"id": "sihH_GMiV5_p"
|
"id": "sihH_GMiV5_p"
|
||||||
@ -1009,6 +1048,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"attachments": {},
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"id": "QvS1yJhOWpiJ"
|
"id": "QvS1yJhOWpiJ"
|
||||||
@ -1086,6 +1126,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"attachments": {},
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"id": "eJ-a8MHg0eYQ"
|
"id": "eJ-a8MHg0eYQ"
|
||||||
@ -1131,6 +1172,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"attachments": {},
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"id": "5CSsA-dW0m_P"
|
"id": "5CSsA-dW0m_P"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user