Skip to content

boostcampaitech3/final-project-level3-nlp-08

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CALL-E

1. About Us

Members

임동진 정재윤 조설아 허치영 이보림
Github Github Github Github Github

Contribution

임동진   :   Dialogue Summarization • Backend • Product Serving
정재윤   :   Dataset Processing • Frontend
조설아   :   Text-to-Image • Text processing
허치영   :   Dialogue Summarization • Documentation
이보림   :   Text-to-Image • Image Dataset

2. Project

채팅 로그 요약문으로 단체카톡방 대표 이미지를 생성해주는 ChatDALL-E

Docs

WHY?

  • 각 채팅방의 특징을 잘 표현하는 대표 이미지 생성

  • 채팅방 혼동으로 인해 의도와 다른 채팅방에 메시지를 잘못 전송하는 경우를 방지하기 위함

HOW?

  • 최근 대화 내역의 요약 문장 제공

  • 최근 대화 내역 요약 문장을 나타내는 이미지 제공

Architecutre

image

3. 시연 영상

최종-데모-영상 (1)

4. Structure

.
├── summarization - model for dialogue summarization
│   └── ...
├── text2image - model for text-to-image (minDALL-E)
│   └── ...
|-- README.md
|-- app.py - Frontend Service
|-- main.py - Backend Service
|-- requirements.txt
|-- client.json - Papago API ID & Key
└── service - methods for frontend/backend
    |-- __init__.py
    |-- back_function.py  - Backend Method
    |-- front_function.py - Frontend Method
    |-- text_to_image.py  - Text to Image Model Method
    └── utils             - Modules required to load the minDALL-E
        |-- __init__.py
        |-- config.py
        |-- vqgan_layer.py
        |-- transfomer_layer.py
        |-- sampling.py
        |-- tokenizer.py
        |-- transformer.py
        |-- utils.py
        └── vqgan.py

5. Usage

Installing required libraries

  • pip install -r requirements.txt --use-feature=2020-resolver
    • use-feature : Library dependency resolver를 위한 argument

Run Frontend-File

  • streamlit run app.py

Run Backend-File

  • uvicorn main:app

Text to Image Model

  • text2image/model/tf_model/model/

    • Fine-tuning 시킨 minDALL-E의 Parameter 저장
  • service/

    • Service에 활용할 minDALL-E Parameter 저장 공간

Dialogue Summarization Model

  • Python
from transformers import BartForConditionalGeneration
model_name = 'chi0/kobart-dial-sum'
model = BartForConditionalGeneration.from_pretrained(model_name)

6. Product Serving

활용한 Cloud

  • Google Cloud Platform
    • 활용 이유 1 : 무료로 GPU를 활용하기에 최적인 Cloud Platform
    • 활용 이유 2 : Machine Learning을 위한 환경을 자동으로 구성해주는 기능 존재

HARDWARE

Environment

  • HTTP 및 HTTPS 트래픽 활용

  • Port : 8501을 제외한 모든 포트는 외부에서 통과 불가능하도록 설정

Cloud에 서비스 활용 방법

  1. pip install -r requirements.txt --use-feature=2020-resolver

    • pip이 설치 되어 있지 않다면 pip 설치가 선행되어야
  2. service directory, main.py, app.py를 Cloud에 Load함

  3. Fine-Tuning 시킨 Text to Image 모델에 대해 저장된 State들을 service 폴더 아래에 저장함

  4. main.py의 txt2imgModel,_ = Rep_Dalle.from_pretrained({HERE})부분에서 {HERE}에 Model State를 저장한 경로를 넣어줌

  5. Papago API에서 번역 API를 신청한 후, API ID 및 Private Key를 client.json 파일에 넣어줌

    • client.json 형식
    {
        "client_id":{Papago API ID},
        "client_secret":{Papago API Key}
    }
    
  6. nohup uvicorn main:app &
    nohup streamlit run app.py &

    • Cloud에서 app.py 및 main.py를 실행시킴으로써 24시간 사이트를 활용할 수 있도록 배포하면 됨
    • 최종 Product Servin Site : {Cloud IP 주소}:8501

7. References

Datasets

Papers

Models

About

final-project-level3-nlp-08 created by GitHub Classroom

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published