|
51 | 51 | }, |
52 | 52 | { |
53 | 53 | "cell_type": "code", |
54 | | - "execution_count": 1, |
| 54 | + "execution_count": null, |
55 | 55 | "id": "aed64e7c-1706-4a78-89ff-75b8a382472a", |
56 | 56 | "metadata": { |
57 | 57 | "jupyter": { |
|
62 | 62 | }, |
63 | 63 | "outputs": [], |
64 | 64 | "source": [ |
65 | | - "# !pip install SQLAlchemy==2.0.31 pymysql" |
| 65 | + "!pip install SQLAlchemy==2.0.31 pymysql dotenv" |
66 | 66 | ] |
67 | 67 | }, |
68 | 68 | { |
|
90 | 90 | "- This demo is limited to run with MLRun 1.9.x Python 3.11, with CPU, a mysql database and run the pipeline with `engine = \"remote\"`.\n", |
91 | 91 | "- GPU is not supported at the moment.\n", |
92 | 92 | "- Need to setup a mysql database for the demo. sqlite is not supported now.\n", |
93 | | - "- Please set `run_with_gpu = False`, `use_sqlite = False`, `engine = \"remote\"`" |
| 93 | + "- Please set `run_with_gpu = False`, `use_sqlite = False`, `engine = \"remote\"`\n", |
| 94 | + "- .env include OPENAI_API_KEY, OPENAI_API_BASE, and MYSQL_URL" |
94 | 95 | ] |
95 | 96 | }, |
96 | 97 | { |
|
108 | 109 | "source": [ |
109 | 110 | "- GPU is not supported at the moment.\n", |
110 | 111 | "- sqlite is supported.\n", |
111 | | - "- Please set `run_with_gpu = False`, `use_sqlite = True`, `engine = \"remote\"`" |
| 112 | + "- Please set `run_with_gpu = False`, `use_sqlite = True`, `engine = \"remote\"`\n", |
| 113 | + "- .env include OPENAI_API_KEY, OPENAI_API_BASE, and S3_BUCKET_NAME" |
112 | 114 | ] |
113 | 115 | }, |
114 | 116 | { |
|
140 | 142 | }, |
141 | 143 | { |
142 | 144 | "cell_type": "code", |
143 | | - "execution_count": null, |
| 145 | + "execution_count": 1, |
144 | 146 | "id": "76f05c23312057a3", |
145 | 147 | "metadata": {}, |
146 | 148 | "outputs": [], |
147 | 149 | "source": [ |
148 | 150 | "# True = run with GPU, False = run with CPU\n", |
149 | 151 | "run_with_gpu = False\n", |
150 | 152 | "language = \"en\" # The languages of the calls, es - Spanish, en - English\n", |
151 | | - "skip_calls_generation = False\n", |
152 | | - "use_sqlite = True" |
| 153 | + "skip_calls_generation = False" |
153 | 154 | ] |
154 | 155 | }, |
155 | 156 | { |
156 | 157 | "cell_type": "code", |
157 | | - "execution_count": null, |
| 158 | + "execution_count": 2, |
158 | 159 | "id": "7e7503f4-8830-4972-a986-10f4c29624b9", |
159 | 160 | "metadata": { |
160 | 161 | "tags": [] |
|
166 | 167 | "True" |
167 | 168 | ] |
168 | 169 | }, |
169 | | - "execution_count": 3, |
| 170 | + "execution_count": 2, |
170 | 171 | "metadata": {}, |
171 | 172 | "output_type": "execute_result" |
172 | 173 | } |
|
176 | 177 | "import os\n", |
177 | 178 | "import sys\n", |
178 | 179 | "import mlrun\n", |
179 | | - "\n", |
180 | 180 | "dotenv_file = \".env\"\n", |
181 | 181 | "sys.path.insert(0, os.path.abspath(\"./\"))\n", |
182 | 182 | "\n", |
|
185 | 185 | }, |
186 | 186 | { |
187 | 187 | "cell_type": "code", |
188 | | - "execution_count": 4, |
| 188 | + "execution_count": 3, |
189 | 189 | "id": "d33fc614-2898-4b12-b34f-62181651a9b5", |
190 | 190 | "metadata": {}, |
191 | 191 | "outputs": [], |
|
195 | 195 | "assert os.environ[\"OPENAI_API_KEY\"]" |
196 | 196 | ] |
197 | 197 | }, |
| 198 | + { |
| 199 | + "cell_type": "code", |
| 200 | + "execution_count": 4, |
| 201 | + "id": "9e2a5fd0-f4ff-486a-9d22-e5b80b7eb2a4", |
| 202 | + "metadata": {}, |
| 203 | + "outputs": [], |
| 204 | + "source": [ |
| 205 | + "if not mlrun.mlconf.is_ce_mode():\n", |
| 206 | + " assert os.environ[\"MYSQL_URL\"]\n", |
| 207 | + " use_sqlite = False\n", |
| 208 | + "else:\n", |
| 209 | + " assert os.environ[\"S3_BUCKET_NAME\"]\n", |
| 210 | + " use_sqlite = True" |
| 211 | + ] |
| 212 | + }, |
198 | 213 | { |
199 | 214 | "cell_type": "markdown", |
200 | 215 | "id": "1ea33fee-ec95-48e3-aae8-9247ae182481", |
|
230 | 245 | "execution_count": null, |
231 | 246 | "id": "80b388f8-5aa3-4b6a-9b6d-b6dca242165e", |
232 | 247 | "metadata": { |
233 | | - "scrolled": true, |
234 | 248 | "tags": [] |
235 | 249 | }, |
236 | 250 | "outputs": [], |
|
239 | 253 | "project = mlrun.get_or_create_project(\n", |
240 | 254 | " name=project_name,\n", |
241 | 255 | " user_project=False,\n", |
| 256 | + " allow_cross_project=True,\n", |
242 | 257 | " parameters={\n", |
243 | 258 | " \"build_image\": True,\n", |
244 | 259 | " \"source\": \"git://github.com/mlrun/demo-call-center.git#main\",\n", |
|
296 | 311 | }, |
297 | 312 | { |
298 | 313 | "cell_type": "code", |
299 | | - "execution_count": 6, |
| 314 | + "execution_count": 14, |
300 | 315 | "id": "adc25213-d4d6-411d-a9b0-edf91007ba33", |
301 | 316 | "metadata": {}, |
302 | 317 | "outputs": [], |
|
343 | 358 | }, |
344 | 359 | { |
345 | 360 | "cell_type": "code", |
346 | | - "execution_count": 7, |
| 361 | + "execution_count": null, |
347 | 362 | "id": "8d3d7cca-ff52-4ffd-98df-7d70e8b083cf", |
348 | 363 | "metadata": {}, |
349 | | - "outputs": [ |
350 | | - { |
351 | | - "data": { |
352 | | - "text/plain": [ |
353 | | - "<mlrun.projects.project.MlrunProject at 0x7fa2d60f05d0>" |
354 | | - ] |
355 | | - }, |
356 | | - "execution_count": 7, |
357 | | - "metadata": {}, |
358 | | - "output_type": "execute_result" |
359 | | - } |
360 | | - ], |
| 364 | + "outputs": [], |
361 | 365 | "source": [ |
362 | 366 | "project.spec.params['build_image']=False\n", |
363 | 367 | "project.save()" |
|
555 | 559 | }, |
556 | 560 | { |
557 | 561 | "cell_type": "code", |
558 | | - "execution_count": 15, |
| 562 | + "execution_count": null, |
559 | 563 | "id": "399ed9c3-2765-4f03-a812-79428e51149e", |
560 | 564 | "metadata": { |
561 | 565 | "tags": [] |
562 | 566 | }, |
563 | | - "outputs": [ |
564 | | - { |
565 | | - "name": "stdout", |
566 | | - "output_type": "stream", |
567 | | - "text": [ |
568 | | - "> 2025-08-18 03:40:34,753 [info] downloading s3://igz1-xingsheng-medium-r/projects/call-center-demo/artifacts/582022de-ef13-47b9-8b63-dbcf8680135e/text-to-audio/0/audio_files.zip to local temp file\n", |
569 | | - "> 2025-08-18 03:40:37,898 [info] downloading s3://igz1-xingsheng-medium-r/projects/call-center-demo/artifacts/582022de-ef13-47b9-8b63-dbcf8680135e/conversation-generation/0/conversations.zip to local temp file\n" |
570 | | - ] |
571 | | - } |
572 | | - ], |
| 567 | + "outputs": [], |
573 | 568 | "source": [ |
574 | 569 | "import zipfile\n", |
575 | 570 | "\n", |
|
669 | 664 | ], |
670 | 665 | "metadata": { |
671 | 666 | "kernelspec": { |
672 | | - "display_name": "mlrun", |
| 667 | + "display_name": "py311", |
673 | 668 | "language": "python", |
674 | | - "name": "mlrun" |
| 669 | + "name": "conda-env-.conda-py311-py" |
675 | 670 | }, |
676 | 671 | "language_info": { |
677 | 672 | "codemirror_mode": { |
|
0 commit comments