Tin Theethawat Savastham commited on
Commit
6cac969
·
1 Parent(s): 9a8258d

✨ Provide the script for online user

Browse files
example/.gitignore CHANGED
@@ -1 +1,2 @@
1
- datasets/
 
 
1
+ datasets/
2
+ tdce-basic/
example/1-Basic-Model-Constructor.ipynb CHANGED
@@ -19,7 +19,7 @@
19
  },
20
  {
21
  "cell_type": "code",
22
- "execution_count": null,
23
  "id": "ae7385ba",
24
  "metadata": {},
25
  "outputs": [],
@@ -33,36 +33,91 @@
33
  "import requests\n",
34
  "import ipywidgets as widgets\n",
35
  "from IPython.display import display\n",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  "\n",
37
- "# fmt:off\n",
38
- "sys.path.append('../model')\n",
39
- "sys.path.append('../functions/matrix_generator')\n",
40
- "sys.path.append('../functions')\n",
41
- "sys.path.append('../functions/data_extractor')\n",
42
  "\n",
43
- "import tdce_model as tdce\n",
44
- "import material_fc_layer as mfl\n",
45
- "import employee_fc_layer as efl\n",
46
- "import capital_fc_layer as cfl\n",
47
- "import loss\n",
48
- "import cost_matrix_class as cmc\n",
49
- "import display_input_variation as diva\n",
50
- "import viyacrab_augmentation as viya\n",
51
- "import adjust_data as ajd\n",
52
- "import result_display as rd\n",
53
  "\n",
54
- "importlib.reload(tdce)\n",
55
- "importlib.reload(mfl)\n",
56
- "importlib.reload(efl)\n",
57
- "importlib.reload(cfl)\n",
58
- "importlib.reload(loss)\n",
59
- "importlib.reload(tdce)\n",
60
- "importlib.reload(cmc)\n",
61
- "importlib.reload(diva)\n",
62
- "importlib.reload(viya)\n",
63
- "importlib.reload(ajd)\n",
64
- "importlib.reload(rd)\n",
65
- "# fmt:on\n"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  ]
67
  },
68
  {
 
19
  },
20
  {
21
  "cell_type": "code",
22
+ "execution_count": 3,
23
  "id": "ae7385ba",
24
  "metadata": {},
25
  "outputs": [],
 
33
  "import requests\n",
34
  "import ipywidgets as widgets\n",
35
  "from IPython.display import display\n",
36
+ "import git"
37
+ ]
38
+ },
39
+ {
40
+ "cell_type": "markdown",
41
+ "id": "bf7b5cc7",
42
+ "metadata": {},
43
+ "source": [
44
+ "If run from online source or Google Collab please run this code for clone the model file"
45
+ ]
46
+ },
47
+ {
48
+ "cell_type": "code",
49
+ "execution_count": 6,
50
+ "id": "4bb874d3",
51
+ "metadata": {},
52
+ "outputs": [],
53
+ "source": [
54
+ "run_from_online = False\n",
55
  "\n",
 
 
 
 
 
56
  "\n",
57
+ "if run_from_online:\n",
58
+ " repo = git.Repo.clone_from('https://huggingface.co/iaecpsu-1/tdce-basic',\n",
59
+ " './tdce-basic',\n",
60
+ " branch='main')\n",
 
 
 
 
 
 
61
  "\n",
62
+ " # fmt:off\n",
63
+ " sys.path.append('./tdce-basic/model')\n",
64
+ " sys.path.append('./tdce-basic/functions/matrix_generator')\n",
65
+ " sys.path.append('./tdce-basic/functions')\n",
66
+ " sys.path.append('./tdce-basic/functions/data_extractor')\n",
67
+ "\n",
68
+ " import tdce_model as tdce\n",
69
+ " import material_fc_layer as mfl\n",
70
+ " import employee_fc_layer as efl\n",
71
+ " import capital_fc_layer as cfl\n",
72
+ " import loss\n",
73
+ " import cost_matrix_class as cmc\n",
74
+ " import display_input_variation as diva\n",
75
+ " import viyacrab_augmentation as viya\n",
76
+ " import adjust_data as ajd\n",
77
+ " import result_display as rd\n",
78
+ "\n",
79
+ " importlib.reload(tdce)\n",
80
+ " importlib.reload(mfl)\n",
81
+ " importlib.reload(efl)\n",
82
+ " importlib.reload(cfl)\n",
83
+ " importlib.reload(loss)\n",
84
+ " importlib.reload(tdce)\n",
85
+ " importlib.reload(cmc)\n",
86
+ " importlib.reload(diva)\n",
87
+ " importlib.reload(viya)\n",
88
+ " importlib.reload(ajd)\n",
89
+ " importlib.reload(rd)\n",
90
+ " # fmt:on\n",
91
+ "else :\n",
92
+ " # fmt:off\n",
93
+ " sys.path.append('../model')\n",
94
+ " sys.path.append('../functions/matrix_generator')\n",
95
+ " sys.path.append('../functions')\n",
96
+ " sys.path.append('../functions/data_extractor')\n",
97
+ " \n",
98
+ " import tdce_model as tdce\n",
99
+ " import material_fc_layer as mfl\n",
100
+ " import employee_fc_layer as efl\n",
101
+ " import capital_fc_layer as cfl\n",
102
+ " import loss\n",
103
+ " import cost_matrix_class as cmc\n",
104
+ " import display_input_variation as diva\n",
105
+ " import viyacrab_augmentation as viya\n",
106
+ " import adjust_data as ajd\n",
107
+ " import result_display as rd\n",
108
+ " \n",
109
+ " importlib.reload(tdce)\n",
110
+ " importlib.reload(mfl)\n",
111
+ " importlib.reload(efl)\n",
112
+ " importlib.reload(cfl)\n",
113
+ " importlib.reload(loss)\n",
114
+ " importlib.reload(tdce)\n",
115
+ " importlib.reload(cmc)\n",
116
+ " importlib.reload(diva)\n",
117
+ " importlib.reload(viya)\n",
118
+ " importlib.reload(ajd)\n",
119
+ " importlib.reload(rd)\n",
120
+ " # fmt:on\n"
121
  ]
122
  },
123
  {
requirement.txt CHANGED
@@ -10,4 +10,5 @@ pyfiglet
10
  seaborn
11
  statsmodels
12
  requests
13
- ipywidgets
 
 
10
  seaborn
11
  statsmodels
12
  requests
13
+ ipywidgets
14
+ GitPython