https://github.com/korshunov-olexiy/install-private-gpt
configure and install privateGPT
https://github.com/korshunov-olexiy/install-private-gpt
Last synced: 3 months ago
JSON representation
configure and install privateGPT
- Host: GitHub
- URL: https://github.com/korshunov-olexiy/install-private-gpt
- Owner: korshunov-olexiy
- License: apache-2.0
- Created: 2024-05-10T12:59:28.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-05-13T13:57:31.000Z (about 1 year ago)
- Last Synced: 2024-05-13T16:44:57.308Z (about 1 year ago)
- Language: Shell
- Size: 37.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Для можливості завантаження обмежених репозиторіїв треба додати token для сайту huggingface.co, для чого змінити файл `./scripts/setup`:
змінити рядок: "from huggingface_hub import hf_hub_download, snapshot_download",
додати імпорт "login", щоб вийшло таким чином:
"from huggingface_hub import hf_hub_download, snapshot_download, login"
Потім, всередині "if __name__ == '__main__':" додати реєстрацію на сайті:
"login(token='my_token')", де 'my_token' змінити на свій токен доступу на сайт https://huggingface.co
Для збільшення буферу пам'яті для чат-двигуна треба змінити файл `./private_gpt/server/chat/chat_service.py`:from llama_index.core.memory import ChatMemoryBuffer # <-- ADD IMPORT
def _chat_engine(
self,
system_prompt: str | None = None,
use_context: bool = False,
context_filter: ContextFilter | None = None,
) -> BaseChatEngine:
if use_context:
vector_index_retriever = self.vector_store_component.get_retriever(
index=self.index, context_filter=context_filter
)
memory = ChatMemoryBuffer.from_defaults(token_limit=8192) # <-- MORE TOKENS
return ContextChatEngine.from_defaults(
system_prompt=system_prompt,
retriever=vector_index_retriever,
memory=memory, # <-- USE THE LARGER BUFFER
llm=self.llm_component.llm,
node_postprocessors=[
MetadataReplacementPostProcessor(target_metadata_key="window"),
],
)