Spaces:
Runtime error
Runtime error
exiomius
commited on
Commit
·
a9eafd0
1
Parent(s):
0e553dc
First push to github
Browse files- .ipynb_checkpoints/NovaOrToast-checkpoint.ipynb +144 -0
- NovaOrToast.ipynb +142 -145
.ipynb_checkpoints/NovaOrToast-checkpoint.ipynb
ADDED
@@ -0,0 +1,144 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "markdown",
|
5 |
+
"id": "6e246129",
|
6 |
+
"metadata": {},
|
7 |
+
"source": [
|
8 |
+
"# "
|
9 |
+
]
|
10 |
+
},
|
11 |
+
{
|
12 |
+
"cell_type": "code",
|
13 |
+
"execution_count": 1,
|
14 |
+
"id": "435a6f23",
|
15 |
+
"metadata": {},
|
16 |
+
"outputs": [],
|
17 |
+
"source": [
|
18 |
+
"#%pip install -q gradio\n",
|
19 |
+
"#%pip install fastbook\n",
|
20 |
+
"#%pip install -Uqq fastai"
|
21 |
+
]
|
22 |
+
},
|
23 |
+
{
|
24 |
+
"cell_type": "code",
|
25 |
+
"execution_count": 2,
|
26 |
+
"id": "a89a7628",
|
27 |
+
"metadata": {},
|
28 |
+
"outputs": [],
|
29 |
+
"source": [
|
30 |
+
"import fastbook\n",
|
31 |
+
"fastbook.setup_book()\n",
|
32 |
+
"from fastbook import *\n",
|
33 |
+
"from fastai.vision.widgets import *\n",
|
34 |
+
"from fastai.vision.all import *\n",
|
35 |
+
"import gradio as gr"
|
36 |
+
]
|
37 |
+
},
|
38 |
+
{
|
39 |
+
"cell_type": "code",
|
40 |
+
"execution_count": 3,
|
41 |
+
"id": "8c95d6bd",
|
42 |
+
"metadata": {},
|
43 |
+
"outputs": [],
|
44 |
+
"source": [
|
45 |
+
"#!pip uninstall Pillow\n",
|
46 |
+
"#!pip install Pillow\n",
|
47 |
+
"# import PIL.Image\n",
|
48 |
+
"# if not hasattr(PIL.Image, 'Resampling'): # Pillow<9.0\n",
|
49 |
+
"# PIL.Image.Resampling = PIL.Image\n",
|
50 |
+
"# Now PIL.Image.Resampling.BICUBIC is always recognized."
|
51 |
+
]
|
52 |
+
},
|
53 |
+
{
|
54 |
+
"cell_type": "code",
|
55 |
+
"execution_count": 4,
|
56 |
+
"id": "fe4889a5",
|
57 |
+
"metadata": {},
|
58 |
+
"outputs": [],
|
59 |
+
"source": [
|
60 |
+
"import pathlib\n",
|
61 |
+
"temp = pathlib.PosixPath\n",
|
62 |
+
"pathlib.PosixPath = pathlib.WindowsPath"
|
63 |
+
]
|
64 |
+
},
|
65 |
+
{
|
66 |
+
"cell_type": "code",
|
67 |
+
"execution_count": 5,
|
68 |
+
"id": "d1d0d596",
|
69 |
+
"metadata": {},
|
70 |
+
"outputs": [
|
71 |
+
{
|
72 |
+
"name": "stderr",
|
73 |
+
"output_type": "stream",
|
74 |
+
"text": [
|
75 |
+
"C:\\Users\\Adnan\\anaconda3\\lib\\site-packages\\gradio\\inputs.py:256: UserWarning: Usage of gradio.inputs is deprecated, and will not be supported in the future, please import your component from gradio.components\n",
|
76 |
+
" warnings.warn(\n",
|
77 |
+
"C:\\Users\\Adnan\\anaconda3\\lib\\site-packages\\gradio\\deprecation.py:40: UserWarning: `optional` parameter is deprecated, and it has no effect\n",
|
78 |
+
" warnings.warn(value)\n",
|
79 |
+
"C:\\Users\\Adnan\\anaconda3\\lib\\site-packages\\gradio\\outputs.py:196: UserWarning: Usage of gradio.outputs is deprecated, and will not be supported in the future, please import your components from gradio.components\n",
|
80 |
+
" warnings.warn(\n",
|
81 |
+
"C:\\Users\\Adnan\\anaconda3\\lib\\site-packages\\gradio\\deprecation.py:40: UserWarning: The 'type' parameter has been deprecated. Use the Number component instead.\n",
|
82 |
+
" warnings.warn(value)\n"
|
83 |
+
]
|
84 |
+
},
|
85 |
+
{
|
86 |
+
"name": "stdout",
|
87 |
+
"output_type": "stream",
|
88 |
+
"text": [
|
89 |
+
"Running on local URL: http://127.0.0.1:7860\n",
|
90 |
+
"\n",
|
91 |
+
"To create a public link, set `share=True` in `launch()`.\n"
|
92 |
+
]
|
93 |
+
},
|
94 |
+
{
|
95 |
+
"data": {
|
96 |
+
"text/plain": [
|
97 |
+
"(<gradio.routes.App at 0x2b7e98ecca0>, 'http://127.0.0.1:7860/', None)"
|
98 |
+
]
|
99 |
+
},
|
100 |
+
"execution_count": 5,
|
101 |
+
"metadata": {},
|
102 |
+
"output_type": "execute_result"
|
103 |
+
}
|
104 |
+
],
|
105 |
+
"source": [
|
106 |
+
"learn_inf = load_learner('NovaOrToastModel.pkl')\n",
|
107 |
+
"learn_inf.dls.vocab # Reminds us of the categories\n",
|
108 |
+
"categories = learn_inf.dls.vocab\n",
|
109 |
+
"\n",
|
110 |
+
"def classify_image(img):\n",
|
111 |
+
" pred, idx, probs = learn_inf.predict(img)\n",
|
112 |
+
" return dict(zip(categories, map(float,probs)))\n",
|
113 |
+
"\n",
|
114 |
+
"image = gr.inputs.Image(shape=(192,192)) \n",
|
115 |
+
"label = gr.outputs.Label()\n",
|
116 |
+
"examples = [\"ToastTest.jpeg\"]\n",
|
117 |
+
"\n",
|
118 |
+
"intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)\n",
|
119 |
+
"intf.launch(inline=False)"
|
120 |
+
]
|
121 |
+
}
|
122 |
+
],
|
123 |
+
"metadata": {
|
124 |
+
"kernelspec": {
|
125 |
+
"display_name": "Python 3 (ipykernel)",
|
126 |
+
"language": "python",
|
127 |
+
"name": "python3"
|
128 |
+
},
|
129 |
+
"language_info": {
|
130 |
+
"codemirror_mode": {
|
131 |
+
"name": "ipython",
|
132 |
+
"version": 3
|
133 |
+
},
|
134 |
+
"file_extension": ".py",
|
135 |
+
"mimetype": "text/x-python",
|
136 |
+
"name": "python",
|
137 |
+
"nbconvert_exporter": "python",
|
138 |
+
"pygments_lexer": "ipython3",
|
139 |
+
"version": "3.9.12"
|
140 |
+
}
|
141 |
+
},
|
142 |
+
"nbformat": 4,
|
143 |
+
"nbformat_minor": 5
|
144 |
+
}
|
NovaOrToast.ipynb
CHANGED
@@ -1,115 +1,49 @@
|
|
1 |
{
|
2 |
"cells": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
{
|
4 |
"cell_type": "code",
|
5 |
"execution_count": 1,
|
6 |
-
"id": "
|
7 |
"metadata": {},
|
8 |
-
"outputs": [
|
9 |
-
{
|
10 |
-
"name": "stdout",
|
11 |
-
"output_type": "stream",
|
12 |
-
"text": [
|
13 |
-
"Note: you may need to restart the kernel to use updated packages.\n",
|
14 |
-
"Requirement already satisfied: fastbook in c:\\users\\adnan\\anaconda3\\lib\\site-packages (0.0.28)\n",
|
15 |
-
"Requirement already satisfied: requests in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from fastbook) (2.28.1)\n",
|
16 |
-
"Requirement already satisfied: fastai>=2.6 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from fastbook) (2.7.9)\n",
|
17 |
-
"Requirement already satisfied: pip in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from fastbook) (22.1.2)\n",
|
18 |
-
"Requirement already satisfied: sentencepiece in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from fastbook) (0.1.97)\n",
|
19 |
-
"Requirement already satisfied: graphviz in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from fastbook) (0.20.1)\n",
|
20 |
-
"Requirement already satisfied: datasets in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from fastbook) (2.4.0)\n",
|
21 |
-
"Requirement already satisfied: packaging in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from fastbook) (21.3)\n",
|
22 |
-
"Requirement already satisfied: pandas in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from fastbook) (1.4.3)\n",
|
23 |
-
"Requirement already satisfied: transformers in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from fastbook) (4.21.3)\n",
|
24 |
-
"Requirement already satisfied: fastdownload<2,>=0.0.5 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from fastai>=2.6->fastbook) (0.0.7)\n",
|
25 |
-
"Requirement already satisfied: matplotlib in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from fastai>=2.6->fastbook) (3.5.2)\n",
|
26 |
-
"Requirement already satisfied: scikit-learn in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from fastai>=2.6->fastbook) (1.1.1)\n",
|
27 |
-
"Requirement already satisfied: spacy<4 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from fastai>=2.6->fastbook) (3.4.1)\n",
|
28 |
-
"Requirement already satisfied: fastprogress>=0.2.4 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from fastai>=2.6->fastbook) (1.0.3)\n",
|
29 |
-
"Requirement already satisfied: scipy in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from fastai>=2.6->fastbook) (1.7.3)\n",
|
30 |
-
"Requirement already satisfied: pillow>6.0.0 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from fastai>=2.6->fastbook) (9.2.0)\n",
|
31 |
-
"Requirement already satisfied: torch<1.14,>=1.7 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from fastai>=2.6->fastbook) (1.12.1)\n",
|
32 |
-
"Requirement already satisfied: torchvision>=0.8.2 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from fastai>=2.6->fastbook) (0.13.1)\n",
|
33 |
-
"Requirement already satisfied: fastcore<1.6,>=1.4.5 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from fastai>=2.6->fastbook) (1.5.26)\n",
|
34 |
-
"Requirement already satisfied: pyyaml in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from fastai>=2.6->fastbook) (6.0)\n",
|
35 |
-
"Requirement already satisfied: dill<0.3.6 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from datasets->fastbook) (0.3.5.1)\n",
|
36 |
-
"Requirement already satisfied: pyarrow>=6.0.0 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from datasets->fastbook) (9.0.0)\n",
|
37 |
-
"Requirement already satisfied: huggingface-hub<1.0.0,>=0.1.0 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from datasets->fastbook) (0.9.1)\n",
|
38 |
-
"Requirement already satisfied: aiohttp in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from datasets->fastbook) (3.8.1)\n",
|
39 |
-
"Requirement already satisfied: fsspec[http]>=2021.11.1 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from datasets->fastbook) (2022.7.1)\n",
|
40 |
-
"Requirement already satisfied: xxhash in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from datasets->fastbook) (3.0.0)\n",
|
41 |
-
"Requirement already satisfied: responses<0.19 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from datasets->fastbook) (0.18.0)\n",
|
42 |
-
"Requirement already satisfied: numpy>=1.17 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from datasets->fastbook) (1.21.5)\n",
|
43 |
-
"Requirement already satisfied: multiprocess in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from datasets->fastbook) (0.70.13)\n",
|
44 |
-
"Requirement already satisfied: tqdm>=4.62.1 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from datasets->fastbook) (4.64.0)\n",
|
45 |
-
"Requirement already satisfied: certifi>=2017.4.17 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from requests->fastbook) (2022.6.15)\n",
|
46 |
-
"Requirement already satisfied: charset-normalizer<3,>=2 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from requests->fastbook) (2.0.4)\n",
|
47 |
-
"Requirement already satisfied: idna<4,>=2.5 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from requests->fastbook) (3.3)\n",
|
48 |
-
"Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from requests->fastbook) (1.26.11)\n",
|
49 |
-
"Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from packaging->fastbook) (3.0.9)\n",
|
50 |
-
"Requirement already satisfied: python-dateutil>=2.8.1 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from pandas->fastbook) (2.8.2)\n",
|
51 |
-
"Requirement already satisfied: pytz>=2020.1 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from pandas->fastbook) (2022.1)\n",
|
52 |
-
"Requirement already satisfied: tokenizers!=0.11.3,<0.13,>=0.11.1 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from transformers->fastbook) (0.12.1)\n",
|
53 |
-
"Requirement already satisfied: filelock in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from transformers->fastbook) (3.6.0)\n",
|
54 |
-
"Requirement already satisfied: regex!=2019.12.17 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from transformers->fastbook) (2022.7.9)\n",
|
55 |
-
"Requirement already satisfied: typing-extensions>=3.7.4.3 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from huggingface-hub<1.0.0,>=0.1.0->datasets->fastbook) (4.3.0)\n",
|
56 |
-
"Requirement already satisfied: six>=1.5 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from python-dateutil>=2.8.1->pandas->fastbook) (1.16.0)\n",
|
57 |
-
"Requirement already satisfied: preshed<3.1.0,>=3.0.2 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from spacy<4->fastai>=2.6->fastbook) (3.0.7)\n",
|
58 |
-
"Requirement already satisfied: langcodes<4.0.0,>=3.2.0 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from spacy<4->fastai>=2.6->fastbook) (3.3.0)\n",
|
59 |
-
"Requirement already satisfied: jinja2 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from spacy<4->fastai>=2.6->fastbook) (2.11.3)\n",
|
60 |
-
"Requirement already satisfied: spacy-legacy<3.1.0,>=3.0.9 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from spacy<4->fastai>=2.6->fastbook) (3.0.10)\n",
|
61 |
-
"Requirement already satisfied: pathy>=0.3.5 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from spacy<4->fastai>=2.6->fastbook) (0.6.2)\n",
|
62 |
-
"Requirement already satisfied: thinc<8.2.0,>=8.1.0 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from spacy<4->fastai>=2.6->fastbook) (8.1.1)\n",
|
63 |
-
"Requirement already satisfied: wasabi<1.1.0,>=0.9.1 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from spacy<4->fastai>=2.6->fastbook) (0.10.1)\n",
|
64 |
-
"Requirement already satisfied: setuptools in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from spacy<4->fastai>=2.6->fastbook) (63.4.1)\n",
|
65 |
-
"Requirement already satisfied: srsly<3.0.0,>=2.4.3 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from spacy<4->fastai>=2.6->fastbook) (2.4.4)\n",
|
66 |
-
"Requirement already satisfied: typer<0.5.0,>=0.3.0 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from spacy<4->fastai>=2.6->fastbook) (0.4.2)\n",
|
67 |
-
"Requirement already satisfied: pydantic!=1.8,!=1.8.1,<1.10.0,>=1.7.4 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from spacy<4->fastai>=2.6->fastbook) (1.9.2)\n",
|
68 |
-
"Requirement already satisfied: spacy-loggers<2.0.0,>=1.0.0 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from spacy<4->fastai>=2.6->fastbook) (1.0.3)\n",
|
69 |
-
"Requirement already satisfied: cymem<2.1.0,>=2.0.2 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from spacy<4->fastai>=2.6->fastbook) (2.0.6)\n",
|
70 |
-
"Requirement already satisfied: catalogue<2.1.0,>=2.0.6 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from spacy<4->fastai>=2.6->fastbook) (2.0.8)\n",
|
71 |
-
"Requirement already satisfied: murmurhash<1.1.0,>=0.28.0 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from spacy<4->fastai>=2.6->fastbook) (1.0.8)\n",
|
72 |
-
"Requirement already satisfied: colorama in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from tqdm>=4.62.1->datasets->fastbook) (0.4.5)\n",
|
73 |
-
"Requirement already satisfied: yarl<2.0,>=1.0 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from aiohttp->datasets->fastbook) (1.8.1)\n",
|
74 |
-
"Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from aiohttp->datasets->fastbook) (4.0.1)\n",
|
75 |
-
"Requirement already satisfied: aiosignal>=1.1.2 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from aiohttp->datasets->fastbook) (1.2.0)\n",
|
76 |
-
"Requirement already satisfied: attrs>=17.3.0 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from aiohttp->datasets->fastbook) (21.4.0)\n",
|
77 |
-
"Requirement already satisfied: frozenlist>=1.1.1 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from aiohttp->datasets->fastbook) (1.2.0)\n",
|
78 |
-
"Requirement already satisfied: multidict<7.0,>=4.5 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from aiohttp->datasets->fastbook) (5.2.0)\n",
|
79 |
-
"Requirement already satisfied: cycler>=0.10 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from matplotlib->fastai>=2.6->fastbook) (0.11.0)\n",
|
80 |
-
"Requirement already satisfied: fonttools>=4.22.0 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from matplotlib->fastai>=2.6->fastbook) (4.25.0)\n",
|
81 |
-
"Requirement already satisfied: kiwisolver>=1.0.1 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from matplotlib->fastai>=2.6->fastbook) (1.4.2)\n",
|
82 |
-
"Requirement already satisfied: threadpoolctl>=2.0.0 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from scikit-learn->fastai>=2.6->fastbook) (2.2.0)\n",
|
83 |
-
"Requirement already satisfied: joblib>=1.0.0 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from scikit-learn->fastai>=2.6->fastbook) (1.1.0)\n",
|
84 |
-
"Requirement already satisfied: smart-open<6.0.0,>=5.2.1 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from pathy>=0.3.5->spacy<4->fastai>=2.6->fastbook) (5.2.1)\n",
|
85 |
-
"Requirement already satisfied: blis<0.10.0,>=0.7.8 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from thinc<8.2.0,>=8.1.0->spacy<4->fastai>=2.6->fastbook) (0.9.1)\n",
|
86 |
-
"Requirement already satisfied: confection<1.0.0,>=0.0.1 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from thinc<8.2.0,>=8.1.0->spacy<4->fastai>=2.6->fastbook) (0.0.1)\n",
|
87 |
-
"Requirement already satisfied: click<9.0.0,>=7.1.1 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from typer<0.5.0,>=0.3.0->spacy<4->fastai>=2.6->fastbook) (8.0.4)\n",
|
88 |
-
"Requirement already satisfied: MarkupSafe>=0.23 in c:\\users\\adnan\\anaconda3\\lib\\site-packages (from jinja2->spacy<4->fastai>=2.6->fastbook) (2.0.1)\n",
|
89 |
-
"Note: you may need to restart the kernel to use updated packages.\n"
|
90 |
-
]
|
91 |
-
},
|
92 |
-
{
|
93 |
-
"name": "stdout",
|
94 |
-
"output_type": "stream",
|
95 |
-
"text": [
|
96 |
-
"Note: you may need to restart the kernel to use updated packages.\n"
|
97 |
-
]
|
98 |
-
}
|
99 |
-
],
|
100 |
"source": [
|
101 |
-
"
|
102 |
-
"%pip install fastbook\n",
|
103 |
-
"%pip install -Uqq fastai"
|
104 |
]
|
105 |
},
|
106 |
{
|
107 |
"cell_type": "code",
|
108 |
"execution_count": 2,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
"id": "a89a7628",
|
110 |
"metadata": {},
|
111 |
"outputs": [],
|
112 |
"source": [
|
|
|
|
|
113 |
"import fastbook\n",
|
114 |
"fastbook.setup_book()\n",
|
115 |
"from fastbook import *\n",
|
@@ -120,17 +54,16 @@
|
|
120 |
},
|
121 |
{
|
122 |
"cell_type": "code",
|
123 |
-
"execution_count":
|
124 |
"id": "8c95d6bd",
|
125 |
"metadata": {},
|
126 |
"outputs": [],
|
127 |
"source": [
|
|
|
|
|
|
|
128 |
"#!pip uninstall Pillow\n",
|
129 |
-
"#!pip install Pillow
|
130 |
-
"# import PIL.Image\n",
|
131 |
-
"# if not hasattr(PIL.Image, 'Resampling'): # Pillow<9.0\n",
|
132 |
-
"# PIL.Image.Resampling = PIL.Image\n",
|
133 |
-
"# Now PIL.Image.Resampling.BICUBIC is always recognized."
|
134 |
]
|
135 |
},
|
136 |
{
|
@@ -140,6 +73,11 @@
|
|
140 |
"metadata": {},
|
141 |
"outputs": [],
|
142 |
"source": [
|
|
|
|
|
|
|
|
|
|
|
143 |
"import pathlib\n",
|
144 |
"temp = pathlib.PosixPath\n",
|
145 |
"pathlib.PosixPath = pathlib.WindowsPath"
|
@@ -147,15 +85,29 @@
|
|
147 |
},
|
148 |
{
|
149 |
"cell_type": "code",
|
150 |
-
"execution_count":
|
151 |
"id": "d1d0d596",
|
152 |
"metadata": {},
|
153 |
"outputs": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
{
|
155 |
"name": "stdout",
|
156 |
"output_type": "stream",
|
157 |
"text": [
|
158 |
-
"Running on local URL: http://127.0.0.1:
|
159 |
"\n",
|
160 |
"To create a public link, set `share=True` in `launch()`.\n"
|
161 |
]
|
@@ -163,56 +115,23 @@
|
|
163 |
{
|
164 |
"data": {
|
165 |
"text/plain": [
|
166 |
-
"(<gradio.routes.App at
|
167 |
]
|
168 |
},
|
169 |
-
"execution_count":
|
170 |
"metadata": {},
|
171 |
"output_type": "execute_result"
|
172 |
-
},
|
173 |
-
{
|
174 |
-
"data": {
|
175 |
-
"text/html": [
|
176 |
-
"\n",
|
177 |
-
"<style>\n",
|
178 |
-
" /* Turns off some styling */\n",
|
179 |
-
" progress {\n",
|
180 |
-
" /* gets rid of default border in Firefox and Opera. */\n",
|
181 |
-
" border: none;\n",
|
182 |
-
" /* Needs to be in here for Safari polyfill so background images work as expected. */\n",
|
183 |
-
" background-size: auto;\n",
|
184 |
-
" }\n",
|
185 |
-
" progress:not([value]), progress:not([value])::-webkit-progress-bar {\n",
|
186 |
-
" background: repeating-linear-gradient(45deg, #7e7e7e, #7e7e7e 10px, #5c5c5c 10px, #5c5c5c 20px);\n",
|
187 |
-
" }\n",
|
188 |
-
" .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n",
|
189 |
-
" background: #F44336;\n",
|
190 |
-
" }\n",
|
191 |
-
"</style>\n"
|
192 |
-
],
|
193 |
-
"text/plain": [
|
194 |
-
"<IPython.core.display.HTML object>"
|
195 |
-
]
|
196 |
-
},
|
197 |
-
"metadata": {},
|
198 |
-
"output_type": "display_data"
|
199 |
-
},
|
200 |
-
{
|
201 |
-
"data": {
|
202 |
-
"text/html": [],
|
203 |
-
"text/plain": [
|
204 |
-
"<IPython.core.display.HTML object>"
|
205 |
-
]
|
206 |
-
},
|
207 |
-
"metadata": {},
|
208 |
-
"output_type": "display_data"
|
209 |
}
|
210 |
],
|
211 |
"source": [
|
212 |
-
"
|
213 |
-
"learn_inf.
|
|
|
214 |
"categories = learn_inf.dls.vocab\n",
|
215 |
"\n",
|
|
|
|
|
|
|
216 |
"def classify_image(img):\n",
|
217 |
" pred, idx, probs = learn_inf.predict(img)\n",
|
218 |
" return dict(zip(categories, map(float,probs)))\n",
|
@@ -224,6 +143,84 @@
|
|
224 |
"intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)\n",
|
225 |
"intf.launch(inline=False)"
|
226 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
227 |
}
|
228 |
],
|
229 |
"metadata": {
|
|
|
1 |
{
|
2 |
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "markdown",
|
5 |
+
"id": "738fc104",
|
6 |
+
"metadata": {},
|
7 |
+
"source": [
|
8 |
+
"# This notebook is the .ipynb file for the model. \n",
|
9 |
+
"The code has been commmented in order to explain various parts, including the unused commented out parts."
|
10 |
+
]
|
11 |
+
},
|
12 |
{
|
13 |
"cell_type": "code",
|
14 |
"execution_count": 1,
|
15 |
+
"id": "3e06a8dc",
|
16 |
"metadata": {},
|
17 |
+
"outputs": [],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
"source": [
|
19 |
+
"#|default_exp app"
|
|
|
|
|
20 |
]
|
21 |
},
|
22 |
{
|
23 |
"cell_type": "code",
|
24 |
"execution_count": 2,
|
25 |
+
"id": "435a6f23",
|
26 |
+
"metadata": {},
|
27 |
+
"outputs": [],
|
28 |
+
"source": [
|
29 |
+
"# On my computer, I use Anaconda, where these packages are already installed, so there is no need to install them on the notebook\n",
|
30 |
+
"# On HuggingFaceSpaces, these packages have been put into requirements.txt so that the website installs them\n",
|
31 |
+
"# Therefore there is no need to install them \n",
|
32 |
+
"\n",
|
33 |
+
"#%pip install -q gradio\n",
|
34 |
+
"#%pip install fastbook\n",
|
35 |
+
"#%pip install -Uqq fastai"
|
36 |
+
]
|
37 |
+
},
|
38 |
+
{
|
39 |
+
"cell_type": "code",
|
40 |
+
"execution_count": 3,
|
41 |
"id": "a89a7628",
|
42 |
"metadata": {},
|
43 |
"outputs": [],
|
44 |
"source": [
|
45 |
+
"#|export\n",
|
46 |
+
"# Importing neccesary modules\n",
|
47 |
"import fastbook\n",
|
48 |
"fastbook.setup_book()\n",
|
49 |
"from fastbook import *\n",
|
|
|
54 |
},
|
55 |
{
|
56 |
"cell_type": "code",
|
57 |
+
"execution_count": 4,
|
58 |
"id": "8c95d6bd",
|
59 |
"metadata": {},
|
60 |
"outputs": [],
|
61 |
"source": [
|
62 |
+
"# There was an error with the module Pillow, it was not updated and I attempted to update it within the notebook\n",
|
63 |
+
"# This was not neccesary as I updated Pillow on my anaconda app and it fixed it.\n",
|
64 |
+
"\n",
|
65 |
"#!pip uninstall Pillow\n",
|
66 |
+
"#!pip install Pillow"
|
|
|
|
|
|
|
|
|
67 |
]
|
68 |
},
|
69 |
{
|
|
|
73 |
"metadata": {},
|
74 |
"outputs": [],
|
75 |
"source": [
|
76 |
+
"# There was an error the first time I ran this code on the notebook: \"NotImplementedError: cannot instantiate 'PosixPath' on your system\"\n",
|
77 |
+
"# this code fixed it, but as it is suited for windows,\n",
|
78 |
+
"# this causes an error on HuggingSpaceFaces, which likely uses linux. \n",
|
79 |
+
"# Strangely, simply commenting this code out does not cause the initial error on HuggingFaceSpaces and works for it\n",
|
80 |
+
"\n",
|
81 |
"import pathlib\n",
|
82 |
"temp = pathlib.PosixPath\n",
|
83 |
"pathlib.PosixPath = pathlib.WindowsPath"
|
|
|
85 |
},
|
86 |
{
|
87 |
"cell_type": "code",
|
88 |
+
"execution_count": 6,
|
89 |
"id": "d1d0d596",
|
90 |
"metadata": {},
|
91 |
"outputs": [
|
92 |
+
{
|
93 |
+
"name": "stderr",
|
94 |
+
"output_type": "stream",
|
95 |
+
"text": [
|
96 |
+
"C:\\Users\\Adnan\\anaconda3\\lib\\site-packages\\gradio\\inputs.py:256: UserWarning: Usage of gradio.inputs is deprecated, and will not be supported in the future, please import your component from gradio.components\n",
|
97 |
+
" warnings.warn(\n",
|
98 |
+
"C:\\Users\\Adnan\\anaconda3\\lib\\site-packages\\gradio\\deprecation.py:40: UserWarning: `optional` parameter is deprecated, and it has no effect\n",
|
99 |
+
" warnings.warn(value)\n",
|
100 |
+
"C:\\Users\\Adnan\\anaconda3\\lib\\site-packages\\gradio\\outputs.py:196: UserWarning: Usage of gradio.outputs is deprecated, and will not be supported in the future, please import your components from gradio.components\n",
|
101 |
+
" warnings.warn(\n",
|
102 |
+
"C:\\Users\\Adnan\\anaconda3\\lib\\site-packages\\gradio\\deprecation.py:40: UserWarning: The 'type' parameter has been deprecated. Use the Number component instead.\n",
|
103 |
+
" warnings.warn(value)\n"
|
104 |
+
]
|
105 |
+
},
|
106 |
{
|
107 |
"name": "stdout",
|
108 |
"output_type": "stream",
|
109 |
"text": [
|
110 |
+
"Running on local URL: http://127.0.0.1:7860\n",
|
111 |
"\n",
|
112 |
"To create a public link, set `share=True` in `launch()`.\n"
|
113 |
]
|
|
|
115 |
{
|
116 |
"data": {
|
117 |
"text/plain": [
|
118 |
+
"(<gradio.routes.App at 0x1b3c1180ac0>, 'http://127.0.0.1:7860/', None)"
|
119 |
]
|
120 |
},
|
121 |
+
"execution_count": 6,
|
122 |
"metadata": {},
|
123 |
"output_type": "execute_result"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
}
|
125 |
],
|
126 |
"source": [
|
127 |
+
"#|export\n",
|
128 |
+
"learn_inf = load_learner('NovaOrToastModel.pkl') # Loading the model\n",
|
129 |
+
"learn_inf.dls.vocab # Returns a list of the categories\n",
|
130 |
"categories = learn_inf.dls.vocab\n",
|
131 |
"\n",
|
132 |
+
"# Gradio code:\n",
|
133 |
+
"\n",
|
134 |
+
"# Function for Gradio to use to classify images\n",
|
135 |
"def classify_image(img):\n",
|
136 |
" pred, idx, probs = learn_inf.predict(img)\n",
|
137 |
" return dict(zip(categories, map(float,probs)))\n",
|
|
|
143 |
"intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)\n",
|
144 |
"intf.launch(inline=False)"
|
145 |
]
|
146 |
+
},
|
147 |
+
{
|
148 |
+
"cell_type": "code",
|
149 |
+
"execution_count": 8,
|
150 |
+
"id": "87f44c7a",
|
151 |
+
"metadata": {},
|
152 |
+
"outputs": [],
|
153 |
+
"source": [
|
154 |
+
"from nbdev.export import notebook2script"
|
155 |
+
]
|
156 |
+
},
|
157 |
+
{
|
158 |
+
"cell_type": "code",
|
159 |
+
"execution_count": 15,
|
160 |
+
"id": "680f2b28",
|
161 |
+
"metadata": {},
|
162 |
+
"outputs": [
|
163 |
+
{
|
164 |
+
"ename": "InterpolationMissingOptionError",
|
165 |
+
"evalue": "Bad value substitution: option 'doc_host' in section 'DEFAULT' contains an interpolation key 'user' which is not a valid option name. Raw value: 'https://%(user)s.github.io'",
|
166 |
+
"output_type": "error",
|
167 |
+
"traceback": [
|
168 |
+
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
|
169 |
+
"\u001b[1;31mInterpolationMissingOptionError\u001b[0m Traceback (most recent call last)",
|
170 |
+
"Input \u001b[1;32mIn [15]\u001b[0m, in \u001b[0;36m<cell line: 3>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mnbdev\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m get_config\n\u001b[0;32m 2\u001b[0m \u001b[38;5;66;03m#get_config (cfg_name='settings.ini', path=None)\u001b[39;00m\n\u001b[1;32m----> 3\u001b[0m \u001b[43mget_config\u001b[49m\u001b[43m \u001b[49m\u001b[43m(\u001b[49m\u001b[43mcfg_name\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43msettings.ini\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m)\u001b[49m\n",
|
171 |
+
"File \u001b[1;32m~\\anaconda3\\lib\\site-packages\\nbdev\\imports.py:30\u001b[0m, in \u001b[0;36mget_config\u001b[1;34m(cfg_name)\u001b[0m\n\u001b[0;32m 28\u001b[0m \u001b[38;5;28;01mwhile\u001b[39;00m cfg_path \u001b[38;5;241m!=\u001b[39m cfg_path\u001b[38;5;241m.\u001b[39mparent \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m (cfg_path\u001b[38;5;241m/\u001b[39mcfg_name)\u001b[38;5;241m.\u001b[39mexists(): cfg_path \u001b[38;5;241m=\u001b[39m cfg_path\u001b[38;5;241m.\u001b[39mparent\n\u001b[0;32m 29\u001b[0m config \u001b[38;5;241m=\u001b[39m Config(cfg_path, cfg_name\u001b[38;5;241m=\u001b[39mcfg_name)\n\u001b[1;32m---> 30\u001b[0m \u001b[43m_add_new_defaults\u001b[49m\u001b[43m(\u001b[49m\u001b[43mconfig\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43md\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mconfig\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mconfig_file\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 31\u001b[0m \u001b[43m \u001b[49m\u001b[43mhost\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mgithub\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdoc_host\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mhttps://\u001b[39;49m\u001b[38;5;132;43;01m%(user)s\u001b[39;49;00m\u001b[38;5;124;43m.github.io\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdoc_baseurl\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43m/\u001b[39;49m\u001b[38;5;132;43;01m%(lib_name)s\u001b[39;49;00m\u001b[38;5;124;43m/\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[0;32m 32\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m config\n",
|
172 |
+
"File \u001b[1;32m~\\anaconda3\\lib\\site-packages\\nbdev\\imports.py:23\u001b[0m, in \u001b[0;36m_add_new_defaults\u001b[1;34m(cfg, file, **kwargs)\u001b[0m\n\u001b[0;32m 21\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m cfg\u001b[38;5;241m.\u001b[39mget(k, \u001b[38;5;28;01mNone\u001b[39;00m) \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m 22\u001b[0m cfg[k] \u001b[38;5;241m=\u001b[39m v\n\u001b[1;32m---> 23\u001b[0m \u001b[43msave_config_file\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfile\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcfg\u001b[49m\u001b[43m)\u001b[49m\n",
|
173 |
+
"File \u001b[1;32m~\\anaconda3\\lib\\site-packages\\fastcore\\foundation.py:240\u001b[0m, in \u001b[0;36msave_config_file\u001b[1;34m(file, d, **kwargs)\u001b[0m\n\u001b[0;32m 238\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mWrite settings dict to a new config file, or overwrite the existing one.\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m 239\u001b[0m config \u001b[38;5;241m=\u001b[39m ConfigParser(\u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[1;32m--> 240\u001b[0m config[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mDEFAULT\u001b[39m\u001b[38;5;124m'\u001b[39m] \u001b[38;5;241m=\u001b[39m d\n\u001b[0;32m 241\u001b[0m config\u001b[38;5;241m.\u001b[39mwrite(\u001b[38;5;28mopen\u001b[39m(file, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mw\u001b[39m\u001b[38;5;124m'\u001b[39m))\n",
|
174 |
+
"File \u001b[1;32m~\\anaconda3\\lib\\configparser.py:977\u001b[0m, in \u001b[0;36mRawConfigParser.__setitem__\u001b[1;34m(self, key, value)\u001b[0m\n\u001b[0;32m 975\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m key \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_sections:\n\u001b[0;32m 976\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_sections[key]\u001b[38;5;241m.\u001b[39mclear()\n\u001b[1;32m--> 977\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mread_dict\u001b[49m\u001b[43m(\u001b[49m\u001b[43m{\u001b[49m\u001b[43mkey\u001b[49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mvalue\u001b[49m\u001b[43m}\u001b[49m\u001b[43m)\u001b[49m\n",
|
175 |
+
"File \u001b[1;32m~\\anaconda3\\lib\\configparser.py:747\u001b[0m, in \u001b[0;36mRawConfigParser.read_dict\u001b[1;34m(self, dictionary, source)\u001b[0m\n\u001b[0;32m 745\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m\n\u001b[0;32m 746\u001b[0m elements_added\u001b[38;5;241m.\u001b[39madd(section)\n\u001b[1;32m--> 747\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m key, value \u001b[38;5;129;01min\u001b[39;00m keys\u001b[38;5;241m.\u001b[39mitems():\n\u001b[0;32m 748\u001b[0m key \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39moptionxform(\u001b[38;5;28mstr\u001b[39m(key))\n\u001b[0;32m 749\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m value \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n",
|
176 |
+
"File \u001b[1;32m~\\anaconda3\\lib\\_collections_abc.py:851\u001b[0m, in \u001b[0;36mItemsView.__iter__\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 849\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m__iter__\u001b[39m(\u001b[38;5;28mself\u001b[39m):\n\u001b[0;32m 850\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m key \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_mapping:\n\u001b[1;32m--> 851\u001b[0m \u001b[38;5;28;01myield\u001b[39;00m (key, \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_mapping\u001b[49m\u001b[43m[\u001b[49m\u001b[43mkey\u001b[49m\u001b[43m]\u001b[49m)\n",
|
177 |
+
"File \u001b[1;32m~\\anaconda3\\lib\\configparser.py:1258\u001b[0m, in \u001b[0;36mSectionProxy.__getitem__\u001b[1;34m(self, key)\u001b[0m\n\u001b[0;32m 1256\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_parser\u001b[38;5;241m.\u001b[39mhas_option(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_name, key):\n\u001b[0;32m 1257\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mKeyError\u001b[39;00m(key)\n\u001b[1;32m-> 1258\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_parser\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_name\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mkey\u001b[49m\u001b[43m)\u001b[49m\n",
|
178 |
+
"File \u001b[1;32m~\\anaconda3\\lib\\configparser.py:799\u001b[0m, in \u001b[0;36mRawConfigParser.get\u001b[1;34m(self, section, option, raw, vars, fallback)\u001b[0m\n\u001b[0;32m 797\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m value\n\u001b[0;32m 798\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m--> 799\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_interpolation\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mbefore_get\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43msection\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43moption\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mvalue\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 800\u001b[0m \u001b[43m \u001b[49m\u001b[43md\u001b[49m\u001b[43m)\u001b[49m\n",
|
179 |
+
"File \u001b[1;32m~\\anaconda3\\lib\\configparser.py:395\u001b[0m, in \u001b[0;36mBasicInterpolation.before_get\u001b[1;34m(self, parser, section, option, value, defaults)\u001b[0m\n\u001b[0;32m 393\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mbefore_get\u001b[39m(\u001b[38;5;28mself\u001b[39m, parser, section, option, value, defaults):\n\u001b[0;32m 394\u001b[0m L \u001b[38;5;241m=\u001b[39m []\n\u001b[1;32m--> 395\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_interpolate_some\u001b[49m\u001b[43m(\u001b[49m\u001b[43mparser\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43moption\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mL\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mvalue\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43msection\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdefaults\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m1\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[0;32m 396\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;241m.\u001b[39mjoin(L)\n",
|
180 |
+
"File \u001b[1;32m~\\anaconda3\\lib\\configparser.py:434\u001b[0m, in \u001b[0;36mBasicInterpolation._interpolate_some\u001b[1;34m(self, parser, option, accum, rest, section, map, depth)\u001b[0m\n\u001b[0;32m 432\u001b[0m v \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mmap\u001b[39m[var]\n\u001b[0;32m 433\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mKeyError\u001b[39;00m:\n\u001b[1;32m--> 434\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m InterpolationMissingOptionError(\n\u001b[0;32m 435\u001b[0m option, section, rawval, var) \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;28mNone\u001b[39m\n\u001b[0;32m 436\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m%\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;129;01min\u001b[39;00m v:\n\u001b[0;32m 437\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_interpolate_some(parser, option, accum, v,\n\u001b[0;32m 438\u001b[0m section, \u001b[38;5;28mmap\u001b[39m, depth \u001b[38;5;241m+\u001b[39m \u001b[38;5;241m1\u001b[39m)\n",
|
181 |
+
"\u001b[1;31mInterpolationMissingOptionError\u001b[0m: Bad value substitution: option 'doc_host' in section 'DEFAULT' contains an interpolation key 'user' which is not a valid option name. Raw value: 'https://%(user)s.github.io'"
|
182 |
+
]
|
183 |
+
}
|
184 |
+
],
|
185 |
+
"source": [
|
186 |
+
"from nbdev import get_config\n",
|
187 |
+
"#get_config (cfg_name='settings.ini', path=None)\n",
|
188 |
+
"get_config (cfg_name='settings.ini')"
|
189 |
+
]
|
190 |
+
},
|
191 |
+
{
|
192 |
+
"cell_type": "code",
|
193 |
+
"execution_count": 10,
|
194 |
+
"id": "475cb737",
|
195 |
+
"metadata": {},
|
196 |
+
"outputs": [
|
197 |
+
{
|
198 |
+
"ename": "InterpolationMissingOptionError",
|
199 |
+
"evalue": "Bad value substitution: option 'doc_host' in section 'DEFAULT' contains an interpolation key 'user' which is not a valid option name. Raw value: 'https://%(user)s.github.io'",
|
200 |
+
"output_type": "error",
|
201 |
+
"traceback": [
|
202 |
+
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
|
203 |
+
"\u001b[1;31mInterpolationMissingOptionError\u001b[0m Traceback (most recent call last)",
|
204 |
+
"Input \u001b[1;32mIn [10]\u001b[0m, in \u001b[0;36m<cell line: 1>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mnotebook2script\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mNovaOrToast.ipynb\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m)\u001b[49m\n",
|
205 |
+
"File \u001b[1;32m~\\anaconda3\\lib\\site-packages\\nbdev\\export.py:444\u001b[0m, in \u001b[0;36mnotebook2script\u001b[1;34m(fname, silent, to_dict, bare)\u001b[0m\n\u001b[0;32m 442\u001b[0m files \u001b[38;5;241m=\u001b[39m nbglob(fname\u001b[38;5;241m=\u001b[39mfname)\n\u001b[0;32m 443\u001b[0m d \u001b[38;5;241m=\u001b[39m collections\u001b[38;5;241m.\u001b[39mdefaultdict(\u001b[38;5;28mlist\u001b[39m) \u001b[38;5;28;01mif\u001b[39;00m to_dict \u001b[38;5;28;01melse\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m--> 444\u001b[0m modules \u001b[38;5;241m=\u001b[39m \u001b[43mcreate_mod_files\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfiles\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mto_dict\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mbare\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mbare\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 445\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m f \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28msorted\u001b[39m(files): d \u001b[38;5;241m=\u001b[39m _notebook2script(f, modules, silent\u001b[38;5;241m=\u001b[39msilent, to_dict\u001b[38;5;241m=\u001b[39md, bare\u001b[38;5;241m=\u001b[39mbare)\n\u001b[0;32m 446\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m to_dict: \u001b[38;5;28;01mreturn\u001b[39;00m d\n",
|
206 |
+
"File \u001b[1;32m~\\anaconda3\\lib\\site-packages\\nbdev\\export.py:327\u001b[0m, in \u001b[0;36mcreate_mod_files\u001b[1;34m(files, to_dict, bare)\u001b[0m\n\u001b[0;32m 325\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mCreate mod files for default exports found in `files`\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m 326\u001b[0m modules \u001b[38;5;241m=\u001b[39m []\n\u001b[1;32m--> 327\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m: lib_path \u001b[38;5;241m=\u001b[39m \u001b[43mget_config\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241m.\u001b[39mpath(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mlib_path\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m 328\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mFileNotFoundError\u001b[39;00m: lib_path \u001b[38;5;241m=\u001b[39m Path()\n\u001b[0;32m 329\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m: nbs_path \u001b[38;5;241m=\u001b[39m get_config()\u001b[38;5;241m.\u001b[39mpath(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mnbs_path\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n",
|
207 |
+
"File \u001b[1;32m~\\anaconda3\\lib\\site-packages\\nbdev\\imports.py:30\u001b[0m, in \u001b[0;36mget_config\u001b[1;34m(cfg_name)\u001b[0m\n\u001b[0;32m 28\u001b[0m \u001b[38;5;28;01mwhile\u001b[39;00m cfg_path \u001b[38;5;241m!=\u001b[39m cfg_path\u001b[38;5;241m.\u001b[39mparent \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m (cfg_path\u001b[38;5;241m/\u001b[39mcfg_name)\u001b[38;5;241m.\u001b[39mexists(): cfg_path \u001b[38;5;241m=\u001b[39m cfg_path\u001b[38;5;241m.\u001b[39mparent\n\u001b[0;32m 29\u001b[0m config \u001b[38;5;241m=\u001b[39m Config(cfg_path, cfg_name\u001b[38;5;241m=\u001b[39mcfg_name)\n\u001b[1;32m---> 30\u001b[0m \u001b[43m_add_new_defaults\u001b[49m\u001b[43m(\u001b[49m\u001b[43mconfig\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43md\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mconfig\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mconfig_file\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 31\u001b[0m \u001b[43m \u001b[49m\u001b[43mhost\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mgithub\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdoc_host\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mhttps://\u001b[39;49m\u001b[38;5;132;43;01m%(user)s\u001b[39;49;00m\u001b[38;5;124;43m.github.io\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdoc_baseurl\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43m/\u001b[39;49m\u001b[38;5;132;43;01m%(lib_name)s\u001b[39;49;00m\u001b[38;5;124;43m/\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[0;32m 32\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m config\n",
|
208 |
+
"File \u001b[1;32m~\\anaconda3\\lib\\site-packages\\nbdev\\imports.py:23\u001b[0m, in \u001b[0;36m_add_new_defaults\u001b[1;34m(cfg, file, **kwargs)\u001b[0m\n\u001b[0;32m 21\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m cfg\u001b[38;5;241m.\u001b[39mget(k, \u001b[38;5;28;01mNone\u001b[39;00m) \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m 22\u001b[0m cfg[k] \u001b[38;5;241m=\u001b[39m v\n\u001b[1;32m---> 23\u001b[0m \u001b[43msave_config_file\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfile\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcfg\u001b[49m\u001b[43m)\u001b[49m\n",
|
209 |
+
"File \u001b[1;32m~\\anaconda3\\lib\\site-packages\\fastcore\\foundation.py:240\u001b[0m, in \u001b[0;36msave_config_file\u001b[1;34m(file, d, **kwargs)\u001b[0m\n\u001b[0;32m 238\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mWrite settings dict to a new config file, or overwrite the existing one.\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m 239\u001b[0m config \u001b[38;5;241m=\u001b[39m ConfigParser(\u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[1;32m--> 240\u001b[0m config[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mDEFAULT\u001b[39m\u001b[38;5;124m'\u001b[39m] \u001b[38;5;241m=\u001b[39m d\n\u001b[0;32m 241\u001b[0m config\u001b[38;5;241m.\u001b[39mwrite(\u001b[38;5;28mopen\u001b[39m(file, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mw\u001b[39m\u001b[38;5;124m'\u001b[39m))\n",
|
210 |
+
"File \u001b[1;32m~\\anaconda3\\lib\\configparser.py:977\u001b[0m, in \u001b[0;36mRawConfigParser.__setitem__\u001b[1;34m(self, key, value)\u001b[0m\n\u001b[0;32m 975\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m key \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_sections:\n\u001b[0;32m 976\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_sections[key]\u001b[38;5;241m.\u001b[39mclear()\n\u001b[1;32m--> 977\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mread_dict\u001b[49m\u001b[43m(\u001b[49m\u001b[43m{\u001b[49m\u001b[43mkey\u001b[49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mvalue\u001b[49m\u001b[43m}\u001b[49m\u001b[43m)\u001b[49m\n",
|
211 |
+
"File \u001b[1;32m~\\anaconda3\\lib\\configparser.py:747\u001b[0m, in \u001b[0;36mRawConfigParser.read_dict\u001b[1;34m(self, dictionary, source)\u001b[0m\n\u001b[0;32m 745\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m\n\u001b[0;32m 746\u001b[0m elements_added\u001b[38;5;241m.\u001b[39madd(section)\n\u001b[1;32m--> 747\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m key, value \u001b[38;5;129;01min\u001b[39;00m keys\u001b[38;5;241m.\u001b[39mitems():\n\u001b[0;32m 748\u001b[0m key \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39moptionxform(\u001b[38;5;28mstr\u001b[39m(key))\n\u001b[0;32m 749\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m value \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n",
|
212 |
+
"File \u001b[1;32m~\\anaconda3\\lib\\_collections_abc.py:851\u001b[0m, in \u001b[0;36mItemsView.__iter__\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 849\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m__iter__\u001b[39m(\u001b[38;5;28mself\u001b[39m):\n\u001b[0;32m 850\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m key \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_mapping:\n\u001b[1;32m--> 851\u001b[0m \u001b[38;5;28;01myield\u001b[39;00m (key, \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_mapping\u001b[49m\u001b[43m[\u001b[49m\u001b[43mkey\u001b[49m\u001b[43m]\u001b[49m)\n",
|
213 |
+
"File \u001b[1;32m~\\anaconda3\\lib\\configparser.py:1258\u001b[0m, in \u001b[0;36mSectionProxy.__getitem__\u001b[1;34m(self, key)\u001b[0m\n\u001b[0;32m 1256\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_parser\u001b[38;5;241m.\u001b[39mhas_option(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_name, key):\n\u001b[0;32m 1257\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mKeyError\u001b[39;00m(key)\n\u001b[1;32m-> 1258\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_parser\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_name\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mkey\u001b[49m\u001b[43m)\u001b[49m\n",
|
214 |
+
"File \u001b[1;32m~\\anaconda3\\lib\\configparser.py:799\u001b[0m, in \u001b[0;36mRawConfigParser.get\u001b[1;34m(self, section, option, raw, vars, fallback)\u001b[0m\n\u001b[0;32m 797\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m value\n\u001b[0;32m 798\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m--> 799\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_interpolation\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mbefore_get\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43msection\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43moption\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mvalue\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 800\u001b[0m \u001b[43m \u001b[49m\u001b[43md\u001b[49m\u001b[43m)\u001b[49m\n",
|
215 |
+
"File \u001b[1;32m~\\anaconda3\\lib\\configparser.py:395\u001b[0m, in \u001b[0;36mBasicInterpolation.before_get\u001b[1;34m(self, parser, section, option, value, defaults)\u001b[0m\n\u001b[0;32m 393\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mbefore_get\u001b[39m(\u001b[38;5;28mself\u001b[39m, parser, section, option, value, defaults):\n\u001b[0;32m 394\u001b[0m L \u001b[38;5;241m=\u001b[39m []\n\u001b[1;32m--> 395\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_interpolate_some\u001b[49m\u001b[43m(\u001b[49m\u001b[43mparser\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43moption\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mL\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mvalue\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43msection\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdefaults\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m1\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[0;32m 396\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;241m.\u001b[39mjoin(L)\n",
|
216 |
+
"File \u001b[1;32m~\\anaconda3\\lib\\configparser.py:434\u001b[0m, in \u001b[0;36mBasicInterpolation._interpolate_some\u001b[1;34m(self, parser, option, accum, rest, section, map, depth)\u001b[0m\n\u001b[0;32m 432\u001b[0m v \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mmap\u001b[39m[var]\n\u001b[0;32m 433\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mKeyError\u001b[39;00m:\n\u001b[1;32m--> 434\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m InterpolationMissingOptionError(\n\u001b[0;32m 435\u001b[0m option, section, rawval, var) \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;28mNone\u001b[39m\n\u001b[0;32m 436\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m%\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;129;01min\u001b[39;00m v:\n\u001b[0;32m 437\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_interpolate_some(parser, option, accum, v,\n\u001b[0;32m 438\u001b[0m section, \u001b[38;5;28mmap\u001b[39m, depth \u001b[38;5;241m+\u001b[39m \u001b[38;5;241m1\u001b[39m)\n",
|
217 |
+
"\u001b[1;31mInterpolationMissingOptionError\u001b[0m: Bad value substitution: option 'doc_host' in section 'DEFAULT' contains an interpolation key 'user' which is not a valid option name. Raw value: 'https://%(user)s.github.io'"
|
218 |
+
]
|
219 |
+
}
|
220 |
+
],
|
221 |
+
"source": [
|
222 |
+
"notebook2script('NovaOrToast.ipynb')"
|
223 |
+
]
|
224 |
}
|
225 |
],
|
226 |
"metadata": {
|