streamlit으로만 주로 만들어 보다가, dash 라이브러리를 사용해야 할 경우가 생겨서 예제로 만들어 보았음.
https://github.com/theangkko/myColabStorage/blob/main/Dash_Chatbot_Colab_Demo_modified.ipynb
myColabStorage/Dash_Chatbot_Colab_Demo_modified.ipynb at main · theangkko/myColabStorage
Contribute to theangkko/myColabStorage development by creating an account on GitHub.
github.com
jupyter notebook안에서도 실행이 가능하기 때문에 간단히 데모로 만들어서 테스트 할 때 써먹기 좋을 것 같음.
아이패드에서도 코랩으로 불러서 사용도 가능하니, 이런저런 테스트 환경을 고민할 필요가 적은 듯.
streamlit으로는 챗봇 구현이 쉬운지 소스가 많은데, dash 라이브러리로 만든 것들 중에서는 5~6개 정도로 손꼽을 정도임.https://plotly.com/examples/generative-ai-chatgpt/
submit등의 버튼은 css로 설정을 다 해줘야지 쓸만 하거나 colab에서는 css가 먹지 않아서 기본 default형태로 보이는 것일 수도 있음.
또한 예전 소스라서 버전v1 >> v2로의 마이그레이션도 직접 해줘야 하는 코드도 더러 있음. 아래 링크참고
reference
https://dash.plotly.com/minimal-app
A Minimal Dash App | Dash for Python Documentation | Plotly
A Minimal Dash App A minimal Dash app will typically look like this: from dash import Dash, html, dcc, callback, Output, Input import plotly.express as px import pandas as pd df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/gapmin
dash.plotly.com
기본적인 dash 콤포넌트 사용법과 개념은 아래 블로그 글이 잘 되어 있음.
https://mz-moonzoo.tistory.com/30
[Dash]Python Dash Layout 구성 (1) feat. dash-bootstrap-components
dash-bootstrap-components dash-bootstrap-components은 Dash 웹 프레임워크를 사용하여 Bootstrap CSS 프레임워크를 통합하는 파이썬 라이브러리입니다. 이를 통해 개발자들은 파이썬 코드로 웹 애플리케이션을
mz-moonzoo.tistory.com
_