Pavan178 commited on
Commit
3ff2f16
·
verified ·
1 Parent(s): 7970ea2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -19,14 +19,14 @@ class AdvancedPdfChatbot:
19
  os.environ["OPENAI_API_KEY"] = openai_api_key
20
  self.embeddings = OpenAIEmbeddings()
21
  self.text_splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=200)
22
- self.llm = ChatOpenAI(temperature=1.5,model_name='gpt-4o',max_tokens=3000)
23
 
24
  self.memory = ConversationBufferMemory(memory_key="chat_history", return_messages=True)
25
  self.qa_chain = None
26
  self.pdf_path = None
27
  self.template = """
28
  I want you to act as a chat assistant for research more similar to ChatGPT itself, specifically focusing on knowledge retrieval. Provide detailed responses with great attention to context understanding and structured format. Be specific and detail-oriented in your responses, ensuring accuracy and depth in information provided.
29
- Note: If you dont know the answer from the given knowledge base say you dont know it, **dont hallucinate**.
30
  Use Relevant formatting such as Headlines, subtexts or ordered lists when required but not always.
31
  Context: {context}
32
  Question: {question}
 
19
  os.environ["OPENAI_API_KEY"] = openai_api_key
20
  self.embeddings = OpenAIEmbeddings()
21
  self.text_splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=200)
22
+ self.llm = ChatOpenAI(temperature=0.5,model_name='gpt-4o')
23
 
24
  self.memory = ConversationBufferMemory(memory_key="chat_history", return_messages=True)
25
  self.qa_chain = None
26
  self.pdf_path = None
27
  self.template = """
28
  I want you to act as a chat assistant for research more similar to ChatGPT itself, specifically focusing on knowledge retrieval. Provide detailed responses with great attention to context understanding and structured format. Be specific and detail-oriented in your responses, ensuring accuracy and depth in information provided.
29
+ If you dont know the answer from the given knowledge base say you dont know it.
30
  Use Relevant formatting such as Headlines, subtexts or ordered lists when required but not always.
31
  Context: {context}
32
  Question: {question}