|
| 1 | +{ |
| 2 | + "cells": [ |
| 3 | + { |
| 4 | + "cell_type": "code", |
| 5 | + "execution_count": null, |
| 6 | + "id": "6bf26409-1391-48a0-9846-64ff6f024392", |
| 7 | + "metadata": {}, |
| 8 | + "outputs": [ |
| 9 | + { |
| 10 | + "name": "stdout", |
| 11 | + "output_type": "stream", |
| 12 | + "text": [ |
| 13 | + "Already on 'main'\n", |
| 14 | + "Your branch is up to date with 'origin/main'.\n" |
| 15 | + ] |
| 16 | + }, |
| 17 | + { |
| 18 | + "name": "stderr", |
| 19 | + "output_type": "stream", |
| 20 | + "text": [ |
| 21 | + "None of PyTorch, TensorFlow >= 2.0, or Flax have been found. Models won't be available and only tokenizers, configuration and file/data utilities can be used.\n", |
| 22 | + "None of PyTorch, TensorFlow >= 2.0, or Flax have been found. Models won't be available and only tokenizers, configuration and file/data utilities can be used.\n" |
| 23 | + ] |
| 24 | + }, |
| 25 | + { |
| 26 | + "name": "stdout", |
| 27 | + "output_type": "stream", |
| 28 | + "text": [ |
| 29 | + "Template was not specified in recipe, using the first template from the card by default.\n" |
| 30 | + ] |
| 31 | + }, |
| 32 | + { |
| 33 | + "name": "stderr", |
| 34 | + "output_type": "stream", |
| 35 | + "text": [ |
| 36 | + "IOPub data rate exceeded.\n", |
| 37 | + "The Jupyter server will temporarily stop sending output\n", |
| 38 | + "to the client in order to avoid crashing it.\n", |
| 39 | + "To change this limit, set the config variable\n", |
| 40 | + "`--ServerApp.iopub_data_rate_limit`.\n", |
| 41 | + "\n", |
| 42 | + "Current values:\n", |
| 43 | + "ServerApp.iopub_data_rate_limit=1000000.0 (bytes/sec)\n", |
| 44 | + "ServerApp.rate_limit_window=3.0 (secs)\n", |
| 45 | + "\n" |
| 46 | + ] |
| 47 | + } |
| 48 | + ], |
| 49 | + "source": [ |
| 50 | + "!git checkout main\n", |
| 51 | + "import json\n", |
| 52 | + "from unitxt.api import load_recipe\n", |
| 53 | + "from unitxt.settings_utils import get_settings\n", |
| 54 | + "settings = get_settings()\n", |
| 55 | + "settings.allow_unverified_code=True\n", |
| 56 | + "recipe = load_recipe(card=\"cards.bfcl.multi_turn.live_multiple_v3\")\n", |
| 57 | + "ms = recipe()\n", |
| 58 | + "print(ms)\n", |
| 59 | + "for i, instance in enumerate(ms[\"test\"]):\n", |
| 60 | + " if i == 916:\n", |
| 61 | + " print(f\"size of instance is {len(json.dumps(instance))}\")\n", |
| 62 | + " sizes = {field: len(json.dumps(instance[field])) for field in instance}\n", |
| 63 | + " print(f\"sizes of all fields in instance: {sizes}\")\n", |
| 64 | + " task_data = json.loads(instance[\"task_data\"])\n", |
| 65 | + " reference_calls = task_data[\"reference_calls\"]\n", |
| 66 | + " print(f\"number of reference_calls generated by the reg expression is: {len(reference_calls)}\")\n", |
| 67 | + " print(f\"one reference call:\\n{reference_calls[0]}\")\n", |
| 68 | + " print(f\"another reference call:\\n{reference_calls[30303]}\")\n", |
| 69 | + " break" |
| 70 | + ] |
| 71 | + } |
| 72 | + ], |
| 73 | + "metadata": { |
| 74 | + "kernelspec": { |
| 75 | + "display_name": "virtual310", |
| 76 | + "language": "python", |
| 77 | + "name": "virtual310" |
| 78 | + }, |
| 79 | + "language_info": { |
| 80 | + "codemirror_mode": { |
| 81 | + "name": "ipython", |
| 82 | + "version": 3 |
| 83 | + }, |
| 84 | + "file_extension": ".py", |
| 85 | + "mimetype": "text/x-python", |
| 86 | + "name": "python", |
| 87 | + "nbconvert_exporter": "python", |
| 88 | + "pygments_lexer": "ipython3", |
| 89 | + "version": "3.10.16" |
| 90 | + } |
| 91 | + }, |
| 92 | + "nbformat": 4, |
| 93 | + "nbformat_minor": 5 |
| 94 | +} |
0 commit comments