ALVHB95 commited on
Commit
0cece18
·
1 Parent(s): a498e63
Files changed (2) hide show
  1. WebScrapping1.0.ipynb +0 -0
  2. app.py +2 -4
WebScrapping1.0.ipynb ADDED
File without changes
app.py CHANGED
@@ -52,7 +52,7 @@ data=loader.load()
52
  text_splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=150)
53
  docs = text_splitter.split_documents(data)
54
  # define embedding
55
- embeddings = HuggingFaceEmbeddings(model_name='thenlper/gte-base')
56
  # create vector database from data
57
  persist_directory = 'docs/chroma/'
58
 
@@ -105,9 +105,7 @@ qa_chain = ConversationalRetrievalChain.from_llm(
105
  )
106
 
107
 
108
- def chat_interface(inputs, chat_history):
109
- question = inputs[0] # Use integer index 0 for the "Question" input
110
- chat_history = inputs[1] # Use integer index 1 for the "Chat History" input
111
  # ConversationalRetrievalChain
112
  result = qa_chain.run({"question": question, "chat_history": chat_history})
113
  print("Debug: Result from qa_chain.run:", result) # Add this line for debugging
 
52
  text_splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=150)
53
  docs = text_splitter.split_documents(data)
54
  # define embedding
55
+ embeddings = HuggingFaceEmbeddings(model_name='thenlper/gte-small')
56
  # create vector database from data
57
  persist_directory = 'docs/chroma/'
58
 
 
105
  )
106
 
107
 
108
+ def chat_interface(question, chat_history):
 
 
109
  # ConversationalRetrievalChain
110
  result = qa_chain.run({"question": question, "chat_history": chat_history})
111
  print("Debug: Result from qa_chain.run:", result) # Add this line for debugging