![](https://private-user-images.githubusercontent.com/38596856/341934864-cb1cd8b7-c556-46a8-ab8d-e093af713433.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU3MzEyNDMsIm5iZiI6MTcyNTczMDk0MywicGF0aCI6Ii8zODU5Njg1Ni8zNDE5MzQ4NjQtY2IxY2Q4YjctYzU1Ni00NmE4LWFiOGQtZTA5M2FmNzEzNDMzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA3VDE3NDIyM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTM1MGY2NTE0ZmQ3ZjczNDBiNmUyYjQ2ODQxOTM2OGUyZDAxNjk4OWI2NGNhNDhkZDg5NjIxNTE3MTFjMWU1ODgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.27rw0SIWqPdgYJaiMWC9lE0CwSeWmBvH-1iUcmN8P0M)
- 서버상에 챗봇을 실행하고 응답을 주고받기 위한 API입니다.
- Fast API를 이용하여 구성하였습니다.
From ddsntc1/ChatbotAPI
# 터미널 실행
uvicorn main:app --port <원하는 포트번호> --reload
import requests
url = '주소:포트번호/query'
payload = {'query': 사용자가 입력한 query를 str형태로 입력받아융}
headers = {'Content-Type': 'application/json'}
response = requests.post(url, json=payload, headers=headers)
response.json() # 모델 응답 결과
# response.json()['response'][0].split('\\nAnswer')[-1][1:] 로 모델 응답부분 잘라주시면 감사하겠습니다
- Environment : Colab L4 GPU
- Method : SFT(Supervised Fine-Tuning) Trainer
- Quantized by : Unsloth