Giter VIP home page Giter VIP logo

genai-platform-docker's Introduction

# Build image

docker build --pull --no-cache -t huggingface-model-app .

Execute container

docker run -e MODEL_NAME=distilgpt2 -p 8000:8000 huggingface-model-app

With private model:

To use some models you should accept terms and conditions inside Hugging Face

docker run -e MODEL_NAME=meta-llama/Meta-Llama-3-8B -e HF_TOKEN=hf_token -p 8000:8000 -v ./../volume:/root/.cache/huggingface huggingface-model-app
```


# Call model

```
curl --location 'http://localhost:8000/generate' \
--header 'Content-Type: application/json' \
--data '{
           "prompt": "Once upon a time",
           "max_length": 150,
           "temperature": 0.7,
           "top_k": 50,
           "top_p": 0.9
         }'

```

# Cache models

Create a directory to host the cache

```
mkdir -p /path/to/your/cache
```

Execute the container with a volume

```
docker run -e MODEL_NAME=distilgpt2 -e HF_TOKEN=your_hf_token \
    -p 8000:8000 \
    -v /path/to/your/cache:/root/.cache/huggingface \
    huggingface-model-app
```

genai-platform-docker's People

Contributors

enrimr avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.