Closed fabriziosalmi closed 3 months ago
I got this if you can help me use the thing.
I'm stalling on this a bit since I want before to improve the app :) thank you I'll ping once needed OFC 👯
this is something that I directly wish to have currently so anything that i can do is fine.
Dockerfile
Create a file named Dockerfile
in the same directory as your Streamlit app (app.py
). This file will define the image with all the necessary dependencies.
# Use the official Python image as a base
FROM python:3.10-slim
# Set the working directory in the container
WORKDIR /app
# Copy the requirements file to the working directory
COPY requirements.txt .
# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the current directory contents into the container at /app
COPY . .
# Expose the port Streamlit will run on
EXPOSE 8501
# Command to run the Streamlit app
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
requirements.txt
FileThis file lists all the Python dependencies required by your app. Create a requirements.txt
file in the same directory and include the following dependencies:
streamlit
pyyaml
Add any other dependencies your app might need.
Open a terminal in the directory containing your Dockerfile
and requirements.txt
, and run the following command to build your Docker image. Replace my-streamlit-app
with your preferred image name.
docker build -t my-streamlit-app .
Once the image is built, you can run the container with the following command:
docker run -p 8501:8501 my-streamlit-app
This maps port 8501 of the Docker container to port 8501 on your local machine, allowing you to access the Streamlit app in your browser at http://localhost:8501
.
If you combine everything, your directory structure should look like this:
/your-app-directory
|-- app.py
|-- Dockerfile
|-- requirements.txt
|-- input/
|-- output/
|-- rewritten/
And the contents of each file would be as follows:
app.py
: The Streamlit app code you provided.Dockerfile
: The Dockerfile code provided above.requirements.txt
:
streamlit
pyyaml
Persistent Storage: If you want to persist data between Docker container runs (e.g., the input/output files), you can use Docker volumes or bind mounts. For example:
docker run -p 8501:8501 -v $(pwd)/input:/app/input -v $(pwd)/output:/app/output -v $(pwd)/rewritten:/app/rewritten my-streamlit-app
Network Settings: Adjust the network settings as needed, especially if you need the container to communicate with other services.
This setup provides a portable and consistent environment for running your Streamlit app, making it easy to deploy and share with others.
I had just seen your post on Reddit I still really would love to use this simply to apply certain prompts to certain feeds. or maybe do multiple rounds of that with different agents kinda deal. Break down jobs etc idk this is all a lot.
Why is this image almost 6gb?!?!
Why is this image almost 6gb?!?!
it get transformers, PyTorch and dictionaries to make it working in both Italian and English.. also it supports all scripts to evaluate metrics of generated content and comparison between generated and source content. in the future I'll make it smaller giving the option to get it 2 ways, minimal or full :) it's not a close future anyway :)
if u want to avoid large download and docker just go pure python and web UI via
streamlit run gui.py --server.port=8501 --server.address=192.168.0.2
(used example values for custom port and listen address)
make docker image smaller tracked here: https://github.com/fabriziosalmi/UglyFeed/issues/19
barely tested, ongoing testing