se0kcess commited on
Commit
21e82a7
β€’
1 Parent(s): 8708852

"change code"

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -68,7 +68,7 @@ def get_text_chunks(documents):
68
  def get_vectorstore(text_chunks):
69
  # μ›ν•˜λŠ” μž„λ² λ”© λͺ¨λΈμ„ λ‘œλ“œν•©λ‹ˆλ‹€.
70
  embeddings = HuggingFaceEmbeddings(model_name='sentence-transformers/all-MiniLM-L12-v2',
71
- model_kwargs={'device': 'cpu'}) # μž„λ² λ”© λͺ¨λΈμ„ μ„€μ •ν•©λ‹ˆλ‹€.
72
  vectorstore = FAISS.from_documents(text_chunks, embeddings) # FAISS 벑터 μŠ€ν† μ–΄λ₯Ό μƒμ„±ν•©λ‹ˆλ‹€.
73
  return vectorstore # μƒμ„±λœ 벑터 μŠ€ν† μ–΄λ₯Ό λ°˜ν™˜ν•©λ‹ˆλ‹€.
74
 
@@ -79,9 +79,9 @@ def get_conversation_chain(vectorstore):
79
  model_path = hf_hub_download(repo_id=model_name_or_path, filename=model_basename)
80
 
81
  llm = LlamaCpp(model_path=model_path,
82
- n_ctx=4086,
83
- input={"temperature": 0.75, "max_length": 2000, "top_p": 1},
84
- verbose=True, )
85
  # λŒ€ν™” 기둝을 μ €μž₯ν•˜κΈ° μœ„ν•œ λ©”λͺ¨λ¦¬λ₯Ό μƒμ„±ν•©λ‹ˆλ‹€.
86
  memory = ConversationBufferMemory(
87
  memory_key='chat_history', return_messages=True)
@@ -113,7 +113,7 @@ def handle_userinput(user_question):
113
  def main():
114
  load_dotenv()
115
  st.set_page_config(page_title="Chat with multiple Files",
116
- page_icon=":books:")
117
  st.write(css, unsafe_allow_html=True)
118
 
119
  if "conversation" not in st.session_state:
 
68
  def get_vectorstore(text_chunks):
69
  # μ›ν•˜λŠ” μž„λ² λ”© λͺ¨λΈμ„ λ‘œλ“œν•©λ‹ˆλ‹€.
70
  embeddings = HuggingFaceEmbeddings(model_name='sentence-transformers/all-MiniLM-L12-v2',
71
+ model_kwargs={'device': 'cpu'}) # μž„λ² λ”© λͺ¨λΈμ„ μ„€μ •ν•©λ‹ˆλ‹€.
72
  vectorstore = FAISS.from_documents(text_chunks, embeddings) # FAISS 벑터 μŠ€ν† μ–΄λ₯Ό μƒμ„±ν•©λ‹ˆλ‹€.
73
  return vectorstore # μƒμ„±λœ 벑터 μŠ€ν† μ–΄λ₯Ό λ°˜ν™˜ν•©λ‹ˆλ‹€.
74
 
 
79
  model_path = hf_hub_download(repo_id=model_name_or_path, filename=model_basename)
80
 
81
  llm = LlamaCpp(model_path=model_path,
82
+ n_ctx=4086,
83
+ input={"temperature": 0.75, "max_length": 2000, "top_p": 1},
84
+ verbose=True, )
85
  # λŒ€ν™” 기둝을 μ €μž₯ν•˜κΈ° μœ„ν•œ λ©”λͺ¨λ¦¬λ₯Ό μƒμ„±ν•©λ‹ˆλ‹€.
86
  memory = ConversationBufferMemory(
87
  memory_key='chat_history', return_messages=True)
 
113
  def main():
114
  load_dotenv()
115
  st.set_page_config(page_title="Chat with multiple Files",
116
+ page_icon=":books:")
117
  st.write(css, unsafe_allow_html=True)
118
 
119
  if "conversation" not in st.session_state: