{ "cells": [ { "cell_type": "markdown", "id": "4a6ab9a2-28a2-445d-8512-a0dc8d1b54e9", "metadata": {}, "source": [ "# Code Generator\n", "\n", "The requirement: use an Open Source model to generate high performance C++ code from Python code\n", "\n", "To replicate this, you'll need to set up a HuggingFace endpoint as I do in the video. It's simple to do, and it's quite satisfying to see the results!\n", "\n", "It's also an important part of your learning; this is the first example of deploying an open source model to be behind an API. We'll return to this in Week 8, but this should plant a seed in your mind for what's involved in moving open source models into production.\n", "\n", "Added the use of inference providers that was introduced recently by Hugging Face to convert the code.\n", "Improved the user prompt to include algorithic efficeiny and performance optimization.\n", "\n", "Added Java as a conversion option.\n", "\n", "Note: C++ commands work on windows environment.\n" ] }, { "cell_type": "markdown", "id": "22e1567b-33fd-49e7-866e-4b635d15715a", "metadata": {}, "source": [ "
\n",
" ![]() | \n",
" \n",
" Important - Pause Endpoints when not in use\n", " \n", " If you do decide to use HuggingFace endpoints for this project, you should stop or pause the endpoints when you are done to avoid accruing unnecessary running cost. The costs are very low as long as you only run the endpoint when you're using it. Navigate to the HuggingFace endpoint UI here, open your endpoint, and click Pause to put it on pause so you no longer pay for it. \n", "Many thanks to student John L. for raising this.\n", "\n", "In week 8 we will use Modal instead of HuggingFace endpoints; with Modal you only pay for the time that you use it and you should get free credits.\n", " \n", " | \n",
"