Daniel Marques commited on
Commit
911d720
1 Parent(s): fbbc3b6

feat: add websocket

Browse files
Files changed (1) hide show
  1. main.py +6 -2
main.py CHANGED
@@ -21,7 +21,7 @@ from langchain.vectorstores import Chroma
21
  from prompt_template_utils import get_prompt_template
22
  from load_models import load_model
23
 
24
- from constants import CHROMA_SETTINGS, EMBEDDING_MODEL_NAME, PERSIST_DIRECTORY, MODEL_ID, MODEL_BASENAME, PATH_NAME_SOURCE_DIRECTORY, SHOW_SOURCES
25
 
26
  class Predict(BaseModel):
27
  prompt: str
@@ -273,7 +273,11 @@ async def websocket_endpoint_room(websocket: WebSocket, room_id: str, user_id: s
273
  return_source_documents=SHOW_SOURCES,
274
  chain_type_kwargs={
275
  "prompt": prompt,
276
- "memory": memory
 
 
 
 
277
  },
278
  )
279
 
 
21
  from prompt_template_utils import get_prompt_template
22
  from load_models import load_model
23
 
24
+ from constants import CHROMA_SETTINGS, EMBEDDING_MODEL_NAME, PERSIST_DIRECTORY, MODEL_ID, MODEL_BASENAME, PATH_NAME_SOURCE_DIRECTORY, SHOW_SOURCES, CONTEXT_WINDOW_SIZE, MAX_NEW_TOKENS
25
 
26
  class Predict(BaseModel):
27
  prompt: str
 
273
  return_source_documents=SHOW_SOURCES,
274
  chain_type_kwargs={
275
  "prompt": prompt,
276
+ "memory": memory,
277
+ "n_ctx": CONTEXT_WINDOW_SIZE,
278
+ "max_tokens": MAX_NEW_TOKENS,
279
+ "n_batch": MAX_NEW_TOKENS,
280
+
281
  },
282
  )
283