All tutorials
    Deploy
    Beginner
    25 min

    Deploy and Publish a Model

    Turn a trained model into a web page, check it, make it yours, and publish it to a Hugging Face Space or GitHub Pages from your own account, then update it and take it down.

    What you will do

    Take a model you have trained, turn it into a web page that runs it in the visitor's own browser, check it, make the page yours, and put it on the internet from your own Hugging Face or GitHub account. Nothing is hosted by DLWAY.

    Before you start

    • A trained model in the open project. Train one in the Model Builder, or follow From Template to Trained Model.
    • A current Chrome or Edge
    • To publish: a Hugging Face account (free) or a GitHub account. You can do the rest without either.

    Step 1: Deploy the model

    Open Deployment. Under Models you trained, each model says what it is and whether it is ready, for example "Table → no / yes". Press Deploy beside yours. A working page appears in the preview on the right, built from what the model takes and gives. If the list is empty, check that the right project is open.

    Step 2: Try the page

    In the preview, enter values (a table model has one box per column, named as in your data) and press Run. A classifier shows each class with its probability; a regressor shows a number. Leave a required box blank and press Run: the page asks for a value, it does not quietly use 0. Try a row from your test data whose answer you know.

    Step 3: Look at inputs and outputs

    Open Inputs and outputs. This is what DLWAY worked out the model takes and gives. Rename a class if the labels are not what you want people to see. Anything it could not find out is listed with one control to answer it.

    Step 4: Make the page yours

    Open App. Change the Title and Tagline, pick an accent colour and the shape of the corners, and watch the preview follow. Turn on Batch scoring from a CSV if people will score many rows, and turn on Works offline and can be installed if the page should keep itself in their browser. Type values in the preview and press Add the current values to make an example a visitor can click.

    Step 5: Read the checks

    Open Checks. Each line says whether the bundle loaded, every output has the right form, and sample inputs give the same answers the Studio gave. It measures the download size and the time for one prediction, and warns about what looks like personal data in the examples and about a model card with no licence. Fix what it names before publishing; a failing check blocks it.

    Step 6: Choose what to build

    Open Targets and tick what you want: the Web app (a folder), a Single HTML file that opens from disk, a Widget for someone else's page, a JavaScript module, or the Model files with a model card. If you work in Python, tick a Streamlit app, a Gradio app, a REST API or a Notebook: each runs the same model and checks itself against the answers DLWAY got when it starts. They run on ONNX Runtime, with no TensorFlow to install, when the model can be written as ONNX and the file has been shown to give TensorFlow.js's numbers (Step 12); otherwise on Keras, and TensorFlow is a large install.

    Step 7: Download it

    Open Publish and press Download web app. Unzip the folder and host it anywhere that serves files, or open the single file straight from disk. It needs no server; TensorFlow.js is loaded from a CDN when the page opens.

    Step 8: Publish it

    Still on Publish, choose a place.

    • Hugging Face static Space: press Sign in with Hugging Face, agree in the popup, then Publish. DLWAY makes a public Space in your account and shows its address. Or choose Use a token instead and paste a token with write access.
    • GitHub Pages: add a token in Settings → Source Control first, then press Publish in the GitHub card.

    Open the address on your phone. Share it below has the link, a QR code and the code to embed the page in another site.

    Step 9: Change it, and go back

    Edit the page, or train the model again, and press Publish new release: the same address now shows the new version. If you do not like it, find the earlier release under Releases and press Roll back to this. When a newer model of the same design exists, a banner offers it with its accuracy beside the current one.

    Step 10: Take it down

    Unpublish deletes the Space or switches Pages off. A site you publish stays up until you do this, and anyone who can open it can also download the model.

    Pretrained models and pipelines

    Switch to A Hugging Face model on the start screen to run a public model through transformers.js and export a page for it. A pipeline's Build Package step makes packages that are listed on the left, each with a download.

    Step 11: Bring in a model made elsewhere

    On the start screen, A model file takes an ONNX file, a TensorFlow.js model (its model.json with the .bin files beside it) or the zip a Teachable Machine project downloads. The file is read in your browser. What it says becomes what the model takes and gives; what it cannot say (what the columns and classes are called, how pictures were scaled, whether its scores are probabilities) you answer under Inputs and outputs. From there it is any other deployment: a page, the Python apps (an ONNX file runs on ONNX Runtime and needs no TensorFlow), checks, a place to publish.

    Step 12: Make it smaller, or run it on ONNX

    At the top of Targets, How the model runs says what runs the model in the browser and in Python and how its weights are stored. Weights can be kept as 16-bit floats (half the size) or 8-bit integers (a quarter), with the size saved and how far the answers move shown first. The page can run on ONNX Runtime Web instead of TensorFlow.js once DLWAY has shown that the ONNX file gives TensorFlow.js's numbers; the Python apps use ONNX Runtime by default when it does, and then install no TensorFlow.

    Step 13: Keep it up to date from a pipeline

    In Pipelines, Templates, choose Retrain a model and keep a live page up to date: it trains, evaluates, passes a quality gate and publishes the deployment you pick. Paste a Hugging Face token in Publish so a scheduled run can publish with no one there.

    Deploying and publishing models and Deployment.

    Try it in DLWAY

    Open the Studio and follow along in a real project. There is nothing to install.

    Open Studio