Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
dnth committed Oct 29, 2024
1 parent fe9d43e commit 4f350fb
Showing 1 changed file with 127 additions and 4 deletions.
131 changes: 127 additions & 4 deletions nbs/phi35.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,77 @@
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "28fa86ac6e7843a4a8d0cd91795aafb3",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"model.safetensors.index.json: 0%| | 0.00/68.9k [00:00<?, ?B/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "94c9459877284e38817ad2871b31ec37",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Loading safetensors checkpoint shards: 0% Completed | 0/2 [00:00<?, ?it/s]\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"INFO 10-29 23:54:28 model_runner.py:1067] Loading model weights took 7.9324 GB\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "8e15c49c8c2642af964bcf98fcd8bfa9",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"image_processing_phi3_v.py: 0%| | 0.00/11.4k [00:00<?, ?B/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"A new version of the following files was downloaded from https://huggingface.co/microsoft/Phi-3-vision-128k-instruct:\n",
"- image_processing_phi3_v.py\n",
". Make sure to double-check they do not contain any added malicious code. To avoid downloading new versions of the code file, you can pin a revision.\n",
"/home/dnth/mambaforge-pypy3/envs/xinfer/lib/python3.10/site-packages/transformers/models/auto/image_processing_auto.py:517: FutureWarning: The image_processor_class argument is deprecated and will be removed in v4.42. Please use `slow_image_processor_class`, or `fast_image_processor_class` instead\n",
" warnings.warn(\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"INFO 10-29 23:54:30 gpu_executor.py:122] # GPU blocks: 2165, # CPU blocks: 682\n",
"INFO 10-29 23:54:30 gpu_executor.py:126] Maximum concurrency for 4096 tokens per request: 8.46x\n",
"INFO 10-29 23:54:32 model_runner.py:1395] Capturing the model for CUDA graphs. This may lead to unexpected consequences if the model is not static. To run the model in eager mode, set 'enforce_eager=True' or use '--enforce-eager' in the CLI.\n",
"INFO 10-29 23:54:32 model_runner.py:1399] CUDA graphs can take additional 1~3 GiB memory per GPU. If you are running out of memory, consider decreasing `gpu_memory_utilization` or enforcing eager mode. You can also reduce the `max_num_seqs` as needed to decrease memory usage.\n",
"INFO 10-29 23:54:33 model_runner.py:1523] Graph capturing finished in 1 secs.\n"
]
}
],
"source": [
Expand All @@ -226,9 +297,34 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"prompt_token_ids (old) [1, 32010, 29871, 13, 29966, 29989, 3027, 29918, 29896, 29989, 29958, 13, 26270, 683, 445, 1967, 29889, 32007, 29871, 13, 32001]\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"Processed prompts: 100%|██████████| 1/1 [00:00<00:00, 1.42it/s, est. speed input: 2742.73 toks/s, output: 22.68 toks/s]\n"
]
},
{
"data": {
"text/plain": [
"'A woman with long hair and glasses is wearing a green blouse,'"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"image = \"../assets/demo/0a6ee446579d2885.jpg\"\n",
"prompt = \"Caption this image.\"\n",
Expand All @@ -237,9 +333,36 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"prompt_token_ids (old) [1, 32010, 29871, 13, 29966, 29989, 3027, 29918, 29896, 29989, 29958, 13, 26270, 683, 445, 1967, 29889, 32007, 29871, 13, 32001]\n",
"prompt_token_ids (old) [1, 32010, 29871, 13, 29966, 29989, 3027, 29918, 29896, 29989, 29958, 13, 26270, 683, 445, 1967, 29889, 32007, 29871, 13, 32001]\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"Processed prompts: 100%|██████████| 2/2 [00:01<00:00, 1.79it/s, est. speed input: 3466.46 toks/s, output: 28.66 toks/s]\n"
]
},
{
"data": {
"text/plain": [
"['The image shows an individual with a blurred face, wearing a green',\n",
" 'A woman with light brown hair and glasses, wearing a green blouse']"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"model.infer_batch([image, image], [prompt, prompt])"
]
Expand Down

0 comments on commit 4f350fb

Please sign in to comment.