sentimentAi / README.md
Alejadro Sanchez-Giraldo
Add docker container
d79de33
|
raw
history blame
1.27 kB
metadata
title: SentimentAi
emoji: 💻
colorFrom: gray
colorTo: indigo
sdk: streamlit
sdk_version: 1.36.0
app_file: app.py
pinned: false
license: mit

Check out the configuration reference at https://huggingface.co./docs/hub/spaces-config-reference

https://launchdarkly.com/blog/build-sentiment-analysis-app-hugging-face-spaces-with-ai-model-feature-flags/

Run on docker

UI

docker run -it -p 8501:8501 --platform=linux/amd64
-e LAUNCHDARKLY_SDK_KEY=""
registry.hf.space/asgface-sentimentai:latest streamlit run app.py

API - WIP

Build your Docker image

docker build -t myapi .

Run your Docker container, mapping port 5001 of the container to port 5001 on your host

docker run -p 5001:5001 -e LAUNCHDARKLY_SDK_KEY="<LAUNCHDARKLY_SDK_KEY>" myapi

Run locally

API

python3 -m venv myenv
source myenv/bin/activate

LAUNCHDARKLY_SDK_KEY= gunicorn -w 4 -b 0.0.0.0:5001 api:app

Build your Docker image

docker build -t myapi .

Run your Docker container, mapping port 5001 of the container to port 5001 on your host

docker run -p 5001:5001 myapi

UI

python3 -m venv myenv
source myenv/bin/activate

LAUNCHDARKLY_SDK_KEY= streamlit run app.py