Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/tutorials/asr_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@
"from transformers import AutoModelForSpeechSeq2Seq\n",
"\n",
"device = \"cuda\" if torch.cuda.is_available() else \"cpu\"\n",
"torch_dtype = torch.float16 if torch.cuda.is_available() else torch.float32\n",
"dtypech.float16 if torch.cuda.is_available() else torch.float32\n",
"\n",
"model_id = \"openai/whisper-large-v3\"\n",
"\n",
"model = AutoModelForSpeechSeq2Seq.from_pretrained(\n",
" model_id,\n",
" torch_dtype=torch_dtype,\n",
" dtype,dtype
" use_safetensors=True,\n",
" low_cpu_mem_usage=True,\n",
")\n",
Expand Down
Binary file added docs/tutorials/baseline_vs_fora.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 7 additions & 7 deletions docs/tutorials/deploying_sana_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@
"model_id = \"Efficient-Large-Model/Sana_600M_512px_diffusers\"\n",
"\n",
"# 2. Load the pre-trained model\n",
"pipe = SanaPipeline.from_pretrained(model_id, variant=\"fp16\", torch_dtype=torch.float16)\n",
"pipe = SanaPipeline.from_pretrained(model_id, variant=\"fp16\", dtype.float16)\n",
"pipe = pipe.to(device)\n",
"\n",
"# 3. Configure Pruna smash\n",
Expand Down Expand Up @@ -506,9 +506,9 @@
"INFO - Detected diffusers model. Using DiffuserHandler with fixed seed.\n",
"- The first element of the batch is passed as input.\n",
"- The generated outputs are expected to have .images attribute.\n",
"Pipelines loaded with `dtype=torch.float16` cannot run with `cpu` device. It is not recommended to move them to `cpu` as running them will fail. Please make sure to use an accelerator to run the pipeline in inference, due to the lack of support for`float16` operations on this device in PyTorch. Please, remove the `torch_dtype=torch.float16` argument, or use another device for inference.\n",
"Pipelines loaded with `dtype=torch.float16` cannot run with `cpu` device. It is not recommended to move them to `cpu` as running them will fail. Please make sure to use an accelerator to run the pipeline in inference, due to the lack of support for`float16` operations on this device in PyTorch. Please, remove the `torch_dtype=torch.float16` argument, or use another device for inference.\n",
"Pipelines loaded with `dtype=torch.float16` cannot run with `cpu` device. It is not recommended to move them to `cpu` as running them will fail. Please make sure to use an accelerator to run the pipeline in inference, due to the lack of support for`float16` operations on this device in PyTorch. Please, remove the `torch_dtype=torch.float16` argument, or use another device for inference.\n",
"Pipelines loaded with `dtype=torch.float16` cannot run with `cpu` device. It is not recommended to move them to `cpu` as running them will fail. Please make sure to use an accelerator to run the pipeline in inference, due to the lack of support for`float16` operations on this device in PyTorch. Please, remove the `dtype=torch.float16` argument, or use another device for inference.\n",
"Pipelines loaded with `dtype=torch.float16` cannot run with `cpu` device. It is not recommended to move them to `cpu` as running them will fail. Please make sure to use an accelerator to run the pipeline in inference, due to the lack of support for`float16` operations on this device in PyTorch. Please, remove the `dtype=torch.float16` argument, or use another device for inference.\n",
"Pipelines loaded with `dtype=torch.float16` cannot run with `cpu` device. It is not recommended to move them to `cpu` as running them will fail. Please make sure to use an accelerator to run the pipeline in inference, due to the lack of support for`float16` operations on this device in PyTorch. Please, remove the `dtype=torch.float16` argument, or use another device for inference.\n",
"INFO - Evaluating stateful metrics.\n",
"INFO - Evaluating isolated inference metrics.\n"
]
Expand Down Expand Up @@ -545,9 +545,9 @@
"name": "stderr",
"output_type": "stream",
"text": [
"Pipelines loaded with `dtype=torch.float16` cannot run with `cpu` device. It is not recommended to move them to `cpu` as running them will fail. Please make sure to use an accelerator to run the pipeline in inference, due to the lack of support for`float16` operations on this device in PyTorch. Please, remove the `torch_dtype=torch.float16` argument, or use another device for inference.\n",
"Pipelines loaded with `dtype=torch.float16` cannot run with `cpu` device. It is not recommended to move them to `cpu` as running them will fail. Please make sure to use an accelerator to run the pipeline in inference, due to the lack of support for`float16` operations on this device in PyTorch. Please, remove the `torch_dtype=torch.float16` argument, or use another device for inference.\n",
"Pipelines loaded with `dtype=torch.float16` cannot run with `cpu` device. It is not recommended to move them to `cpu` as running them will fail. Please make sure to use an accelerator to run the pipeline in inference, due to the lack of support for`float16` operations on this device in PyTorch. Please, remove the `torch_dtype=torch.float16` argument, or use another device for inference.\n"
"Pipelines loaded with `dtype=torch.float16` cannot run with `cpu` device. It is not recommended to move them to `cpu` as running them will fail. Please make sure to use an accelerator to run the pipeline in inference, due to the lack of support for`float16` operations on this device in PyTorch. Please, remove the `dtype=torch.float16` argument, or use another device for inference.\n",
"Pipelines loaded with `dtype=torch.float16` cannot run with `cpu` device. It is not recommended to move them to `cpu` as running them will fail. Please make sure to use an accelerator to run the pipeline in inference, due to the lack of support for`float16` operations on this device in PyTorch. Please, remove the `dtype=torch.float16` argument, or use another device for inference.\n",
"Pipelines loaded with `dtype=torch.float16` cannot run with `cpu` device. It is not recommended to move them to `cpu` as running them will fail. Please make sure to use an accelerator to run the pipeline in inference, due to the lack of support for`float16` operations on this device in PyTorch. Please, remove the `dtype=torch.float16` argument, or use another device for inference.\n"
]
},
{
Expand Down
22 changes: 5 additions & 17 deletions docs/tutorials/diffusion_quantization_acceleration.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"import torch\n",
"from diffusers import FluxPipeline\n",
"\n",
"pipe = FluxPipeline.from_pretrained(\"black-forest-labs/FLUX.1-schnell\", torch_dtype=torch.bfloat16).to(\"cuda\")"
"pipe = FluxPipeline.from_pretrained(\"black-forest-labs/FLUX.1-schnell\", dtype.bfloat16).to(\"cuda\")"
]
},
{
Expand Down Expand Up @@ -138,19 +138,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"ename": "",
"evalue": "",
"output_type": "error",
"traceback": [
"\u001b[1;31mThe Kernel crashed while executing code in the current cell or a previous cell. \n",
"\u001b[1;31mPlease review the code in the cell(s) to identify a possible cause of the failure. \n",
"\u001b[1;31mClick <a href='https://aka.ms/vscodeJupyterKernelCrash'>here</a> for more info. \n",
"\u001b[1;31mView Jupyter <a href='command:jupyter.viewOutput'>log</a> for further details."
]
}
],
"outputs": [],
"source": [
"# Define the prompt\n",
"prompt = \"a smiling cat dancing on a table. Miyazaki style\"\n",
Expand All @@ -167,7 +155,7 @@
]
},
{
"cell_type": "raw",
"cell_type": "markdown",
"metadata": {
"raw_mimetype": "text/restructuredtext",
"vscode": {
Expand All @@ -183,7 +171,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "pruna",
"display_name": ".venv",
"language": "python",
"name": "python3"
},
Expand All @@ -197,7 +185,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.11"
"version": "3.12.11"
}
},
"nbformat": 4,
Expand Down
Loading
Loading