torchbot
1.0.0
전보 봇 코드? Pytorch LLM에 특화되어 있습니다
이 프로젝트는 Pytorch에 대한 채팅을 위해 텍스트 Mesagge Chatbot을 시뮬레이션하는 것을 목표로합니다.
이 간소화 된 아키텍처에서, 챗봇 역사는 상호 작용 기록의 중심 저장소 역할을하며, 역사적 맥락의 검색과 LLM의 완전한 응답을 포함하여 새로운 상호 작용의 로깅을 모두 지원합니다. 챗봇 UI, 리트리버, 벡터 데이터베이스, 프롬프트 스토리지 및 LLM은 모두 유체 대화 루프에서 역할을 수행하여 사용자에게 완벽한 채팅 경험을 제공합니다.
+--------+--------+ (11)
| |
| Chatbot UI |
| |
+--------+--------+
^
|
(2) input|(10) output
v
+--------+-----------+
| | (9) response content
| Chatbot History +<-------------------------------+
| | |
+--------+-----------+ |
| |
| (3) message |
v ^
+-------------------+ +---------+------------+ (4) +---------+-----------+
| | | | | |
|Vector Database ? +---------->| Retriever ? | | requests History ? |
| | | | | |
+-------------------+ +---------+------------+ +---------+-----------+
| ^
| (5) Augmented message |
v |
+--------+---------+ (6) |
| | |
|Prompt Storage | |
| | |
+--------+---------+ |
| |
| (7) Augmented prompt with LLM params |
| |
v |
+--------+-----------+ |
| | |
| LLM ? | (8) Generated response |
| (Large Language +--------------------------------+
| Model) |
| |
+--------------------+
시작하기 전에 다음과 같은 전제 조건이 있는지 확인하십시오.
.env 파일을 설정하는 것을 잊지 마십시오. Repo에서 무시되지 않습니다. 다음 단계에 따라 프로젝트를 설정하고 실행하십시오.
저장소 복제 :
git clone [email protected]:DLesmes/torchbot.git
cd torchbot
요구 사항으로 Python 가상 환경을 설정합니다 .txt :
python3 -m venv venv
source venv/bin/activate
python3 -m pip install -r requirements.txt
서버 실행 :
python3 main.py
선호하는 IDE에서 디버깅 할 수도 있습니다.
기본적으로 history.json 파일은 다음 버전에 대해 개발할 수있는 No-SQL 데이터베이스를 시뮬레이션 하여이 파일을 만들어 다음과 같이 생각합니다.
{
"<user_id>": [
{
"full_chat": [
{
"reply_id": srt, // reply id
"role": "system", // by default the first reply role is the "system"
"content": srt, // message content
"timestamp": int, // timestamp in milliseconds
},
{
"reply_id": str, // reply id
"role": "user", // by default the second reply role is the "user"
"content": srt, // message content
"timestamp": int, // timestamp in milliseconds
},
{
"reply_id": str, // reply id
"role": "assitant", // by default the third reply role is the "assistant"
"content": srt, // message content
"timestamp": int, // timestamp in milliseconds
},
{
"reply_id": str, // reply id
"role": str, // role of the user
"content": srt, // message content
"timestamp": int, // timestamp in milliseconds
}
]
}
]
}
기본적으로 requests.json 파일이 생성됩니다. 다음 버전에 대해 개발할 수있는 No-SQL 데이터베이스를 시뮬레이션 하여이 파일은 다음과 같이 생각합니다.
{
"<reply_id>": [
{
"user_id": srt, // reply id
"prompt": srt, // message content
"response": int, // timestamp in milliseconds
"timestamp": int, // timestamp in milliseconds
}
]
}
기여 하고이 챗봇 프로젝트를 더 좋게 만들 수 있습니다! 우리는 지역 사회의 기여를 환영합니다! 기여하려면 다음을 따르십시오.
git checkout -b feature/YourFeatureNamegit commit -am 'Add some feature'git push origin feature/YourFeatureName질문이나 제안이 있으시면 여기에 연락하십시오.