|
79 | 79 | "cell_type": "code", |
80 | 80 | "metadata": {}, |
81 | 81 | "source": [ |
82 | | - "URL = 'https://api.platform.mlcube.com'\n", |
83 | | - "API_KEY = ''\n", |
84 | | - "PROJECT_ID = ''\n", |
| 82 | + "URL = 'https://pre.api.platform.mlcube.com'\n", |
| 83 | + "API_KEY = 'VbDyZ4U7Gbe60nK4UlL4aqOOpZrBLHl7flm0uVzuCj9iwyatWcYcezaOBAzckCOh'\n", |
| 84 | + "PROJECT_ID = '669fbec80b64f51d12f1d12d'\n", |
85 | 85 | "model_name = 'mymodel'\n", |
86 | 86 | "model_version = 'v0.0.1'" |
87 | 87 | ], |
|
261 | 261 | " if with_prediction:\n", |
262 | 262 | " with open(prediction_samples_filename, 'w') as f:\n", |
263 | 263 | " json.dump(prediction_text_samples, f)\n", |
264 | | - " \n", |
| 264 | + " \n", |
265 | 265 | " # Create embedding dataframe\n", |
266 | 266 | " print('Creating embedding file')\n", |
267 | 267 | " embeddings_input = pl.DataFrame({\n", |
268 | 268 | " 'timestamp': timestamps,\n", |
269 | 269 | " 'sample-id': sample_ids,\n", |
270 | | - " f'{USER_INPUT_COL_NAME}_embeddings': embedder.encode((dataset[USER_INPUT_COL_NAME])).tolist(),\n", |
271 | | - " f'{CONTEXT_COL_NAME}_embeddings': embedder.encode((dataset[CONTEXT_COL_NAME])).tolist(), \n", |
| 270 | + " f'{USER_INPUT_COL_NAME}_embeddings': embedder.encode(dataset[USER_INPUT_COL_NAME]).tolist(),\n", |
| 271 | + " f'{CONTEXT_COL_NAME}_embeddings': embedder.encode(dataset[CONTEXT_COL_NAME]).tolist(), \n", |
272 | 272 | " })\n", |
273 | 273 | " embeddings_input.write_parquet(input_embeddings_filename)\n", |
274 | 274 | " \n", |
275 | 275 | " if with_prediction:\n", |
276 | 276 | " embeddings_prediction = pl.DataFrame({\n", |
277 | 277 | " 'timestamp': timestamps,\n", |
278 | 278 | " 'sample-id': sample_ids,\n", |
279 | | - " f'{model_name}_embeddings@{model_version}': embedder.encode((dataset[ANSWER_COL_NAME])).tolist(),\n", |
| 279 | + " f'{model_name}_embeddings@{model_version}': embedder.encode(dataset[ANSWER_COL_NAME]).tolist(),\n", |
280 | 280 | " })\n", |
281 | 281 | " \n", |
282 | 282 | " embeddings_prediction.write_parquet(prediction_embeddings_filename)\n", |
|
540 | 540 | " version=model_version,\n", |
541 | 541 | " metric_name=None, # Must be None in RAG tasks\n", |
542 | 542 | " preferred_suggestion_type=None, # Must be None in RAG tasks\n", |
543 | | - " with_probabilistic_output=False\n", |
| 543 | + " with_probabilistic_output=False,\n", |
544 | 544 | ")" |
545 | 545 | ], |
546 | 546 | "outputs": [], |
|
613 | 613 | { |
614 | 614 | "cell_type": "markdown", |
615 | 615 | "metadata": {}, |
616 | | - "source": [ |
617 | | - "Send production data asynchronously, first *inputs* and *predictions* and then *target*" |
618 | | - ] |
| 616 | + "source": "Send production data asynchronously, first *inputs* and then *predictions*" |
619 | 617 | }, |
620 | 618 | { |
621 | 619 | "cell_type": "code", |
|
0 commit comments