Skip to content

Commit

Permalink
document how to swap in another model like deepseek (#33784)
Browse files Browse the repository at this point in the history
* document how to swap in another model like deepseek

* Add header
  • Loading branch information
damccorm authored Jan 28, 2025
1 parent de92049 commit 5682d16
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions examples/notebooks/beam-ml/run_inference_huggingface.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,27 @@
}
]
},
{
"cell_type": "markdown",
"source": [
"### Try with a different model\n",
"One of the best parts of using RunInference is how easy it is to swap in different models. For example, if we wanted to use a larger model like DeepSeek-R1-Distill-Llama-8B outside of Colab (which has very tight memory constraints and limited GPU access), all we need to change is our ModelHandler:\n",
"\n",
"```\n",
"model_handler = HuggingFacePipelineModelHandler(\n",
" task=PipelineTask.Translation_XX_to_YY,\n",
" model = \"deepseek-ai/DeepSeek-R1-Distill-Llama-8B\",\n",
" load_pipeline_args={'framework': 'pt'},\n",
" inference_args={'max_length': 400}\n",
")\n",
"```\n",
"\n",
"We can then run the exact same pipeline code and Beam will take care of the rest."
],
"metadata": {
"id": "LWNM81ivoZcF"
}
},
{
"cell_type": "markdown",
"source": [
Expand Down

0 comments on commit 5682d16

Please sign in to comment.