[AI] LLM RAG 환경 구성 - 4 streamlit 구성 > 머신러닝/AI 자료실

본문 바로가기

사이트 내 전체검색

뒤로가기 머신러닝/AI 자료실

[AI] LLM RAG 환경 구성 - 4 streamlit 구성

페이지 정보

작성자 꿈꾸는여행자 작성일 24-10-08 11:13 조회 70 댓글 0

본문

안녕하세요.

 

꿈꾸는여행자입니다.

 

 

LLM RAG 환경 구성을 다루고자 합니다.


이번 항목에서는 

 

streamlit  구성 실습을 진행해 보도록 하겠습니다. 

 

상세 내역은 아래와 같습니다.



감사합니다. 


> 아래 

 


________________



목차


4. streamlit        21

4.1. Prepare        21

4.1.1. Install Python Packages        21

4.2. Setting        21

4.2.1. main.py - LANGSERVE_ENDPOINT        21

4.3. Run        22

4.3.1. Run - streamlit        22

4.3. Check - Browser        23



________________



4. streamlit

4.1. Prepare 

4.1.1. Install Python Packages

* Install

   * pip install unstructured[pdf]

      * 30분 소요

pip install streamlit



pip install langchain



pip install unstructured



pip install unstructured[pdf]

(env) [lds@llm llm]$ pwd

/home/lds/Works/llm

(env) [lds@llm llm]$ 

(env) [lds@llm llm]$ pip install streamlit

Collecting streamlit

  Downloading streamlit-1.34.0-py2.py3-none-any.whl (8.5 MB)

     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 8.5/8.5 MB 2.7 MB/s eta 0:00:00

Collecting altair<6,>=4.0

  Using cached altair-5.3.0-py3-none-any.whl (857 kB)

Installing collected packages: pytz, watchdog, tzdata, tornado, toolz, toml, smmap, six, rpds-py, pyarrow, protobuf, pillow, cachetools, blinker, referencing, python-dateutil, pydeck, gitdb, pandas, jsonschema-specifications, gitpython, jsonschema, altair, streamlit

Successfully installed altair-5.3.0 blinker-1.8.1 cachetools-5.3.3 gitdb-4.0.11 gitpython-3.1.43 jsonschema-4.22.0 jsonschema-specifications-2023.12.1 pandas-2.2.2 pillow-10.3.0 protobuf-4.25.3 pyarrow-16.0.0 pydeck-0.9.0 python-dateutil-2.9.0.post0 pytz-2024.1 referencing-0.35.1 rpds-py-0.18.0 six-1.16.0 smmap-5.0.1 streamlit-1.34.0 toml-0.10.2 toolz-0.12.1 tornado-6.4 tzdata-2024.1 watchdog-4.0.0



[notice] A new release of pip available: 22.3.1 -> 24.0

[notice] To update, run: pip install --upgrade pip

(env) [lds@llm llm]$ pip install langchain

(env) [lds@llm llm]$ pip install unstructured

(env) [lds@llm llm]$ pip install unstructured[pdf]




4.2. Setting

4.2.1. main.py - LANGSERVE_ENDPOINT

* langserve 접근 정보를 확인하여 수정적용 

   * cd example



vi main.py



# 2) LocalHost 접속: 끝에 붙는 N4XyA 는 각자 다르니

# http://localhost:8000/llm/playground 에서 python SDK 에서 확인!

# LANGSERVE_ENDPOINT = "http://localhost:8000/llm/c/N4XyA"

LANGSERVE_ENDPOINT = "http://192.168.50.130:8000/llm/c/N4XyA"



(env) [lds@llm example]$ pwd

/home/lds/Works/llm/example

(env) [lds@llm example]$ vi main.py 

(env) [lds@llm example]$ 

   * 


4.3. Run 

4.3.1. Run - streamlit



streamlit run main.py 

[lds@llm ~]$ cd /home/lds/Works/llm/example

[lds@llm example]$ pwd

/home/lds/Works/llm/example

[lds@llm example]$ source ../env/bin/activate

(env) [lds@llm example]$ 

(env) [lds@llm example]$ pwd

/home/lds/Works/llm/example

(env) [lds@llm example]$

(env) [lds@llm example]$ streamlit run main.py 



Collecting usage statistics. To deactivate, set browser.gatherUsageStats to false.





  You can now view your Streamlit app in your browser.



  Network URL: http://192.168.50.130:8501

  External URL: http://1.235.192.217:8501








4.3. Check - Browser

* Browser

   * http://192.168.50.130:8501

 

 

댓글목록 0

등록된 댓글이 없습니다.

Copyright © 소유하신 도메인. All rights reserved.

사이트 정보

회사명 : (주)리눅스데이타시스템 / 대표 : 정정모
서울본사 : 서울특별시 강남구 봉은사로 114길 40 홍선빌딩 2층 / tel : 02-6207-1160
대전지사 : 대전광역시 유성구 노은로174 도원프라자 5층 / tel : 042-331-1161

PC 버전으로 보기