LLM
-
나의 TXT 데이터를 OpenAI를 이용하여 FastAPI로 서비스해보자!AI&ML 2023. 5. 3. 00:10
안녕하세요. LLM 모델인 chat gpt 를 활용해서 나만의 텍스트 데이터를 OpenAI를 연동해서 질문해 보는 서비스를 만들어 보겠습니다. 간단하게 파이썬을 이용해서 아래와 같은 순서로 작업합니다. 필요한 라이브러리를 설치해줍니다. openai 같은 LLM 모델들을 이용해서 애플리케이션을 개발하는데 유용한 Langchain 라이브러리를 이용합니다. from fastapi import FastAPI ,File, UploadFile , Request from pydantic import BaseModel from langchain.document_loaders import DirectoryLoader, TextLoader from langchain.text_splitter import CharacterT..