Skip to content

Commit

Permalink
Localhost CSS enhancements
Browse files Browse the repository at this point in the history
Signed-off-by: Taylor Dolezal <[email protected]>
  • Loading branch information
onlydole committed Mar 8, 2024
1 parent 9938407 commit 64ff29d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ COPY requirements.txt .

RUN pip install --upgrade -r requirements.txt

COPY *.py .
COPY . .

EXPOSE 8501

Expand Down
9 changes: 7 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import base64
import streamlit as st
from ollama import Client

Expand All @@ -9,13 +10,17 @@ def process_stream(stream):
for chunk in stream:
yield chunk['message']['content']

def get_base64_encoded_image(image_path):
with open(image_path, "rb") as img_file:
return base64.b64encode(img_file.read()).decode('utf-8')

# Streamlit UI

base64_image = get_base64_encoded_image('img/kccneu24.png')
styl = f"""
<style>
/* not great support for :has yet (hello FireFox), but using it for now */
.main {{
background-image: url('https://vior-lys.s3.amazonaws.com/img/kccneu24.png');
background-image: url(data:image/png;base64,{base64_image});
background-repeat: repeat;
background-size: cover;
background-attachment: fixed;
Expand Down
Binary file added img/kccneu24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 64ff29d

Please sign in to comment.