import streamlit as st from transformers import pipeline from PIL import Image from utils import print_messages # pipeline = pipeline(task="image-classification", model="julien-c/hotdog-not-hotdog") st.set_page_config(page_title="Shim-Dot", page_icon="πŸ€—") st.title("πŸ€— Shim-Dot") # file_name = st.file_uploader("Upload a hot dog candidate image") '''if file_name is not None: col1, col2 = st.columns(2) image = Image.open(file_name) col1.image(image, use_column_width=True) predictions = pipeline(image) col2.header("Probabilities") for p in predictions: col2.subheader(f"{ p['label'] }: { round(p['score'] * 100, 1)}%")''' if "messages" not in st.session_state: st.session_state["messages"] = [] # 이전 λŒ€ν™” 좜λ ₯ μ½”λ“œ print_messages() if user_input := st.chat_input("νŽΈν•˜κ²Œ 말씀해 λ³΄μ„Έμš”."): # μ‚¬μš©μž μž…λ ₯ λ‚΄μš© st.chat_message("user").write(f"{user_input}") #st.session_state["messages"].append(("user", user_input)) st.session_state["messages"].append(("user", user_input)) # AI λ‹΅λ³€ with st.chat_message("assistant"): msg = f"당신이 μž…λ ₯ν•œ λ‚΄μš© : {user_input}" st.write(msg) st.session_state["messages"].append(("assistant", msg))