holy commited on
Commit
7e9bcc1
1 Parent(s): 58661ca

module import fix

Browse files
Files changed (2) hide show
  1. app.py +11 -5
  2. requirements.txt +2 -1
app.py CHANGED
@@ -12,19 +12,25 @@ from transformers import (
12
  pipeline,
13
  BitsAndBytesConfig
14
  )
15
- from langchain.vectorstores import FAISS
16
  from langchain.chains import ConversationalRetrievalChain
17
  from langchain.memory import ConversationBufferMemory
18
- from langchain.llms import HuggingFacePipeline
19
- from langchain.embeddings import HuggingFaceEmbeddings
20
  from langchain_huggingface import HuggingFaceEndpoint
21
 
 
 
 
 
 
 
 
22
  load_dotenv()
23
 
24
  list_llm = [
25
  "meta-llama/Meta-Llama-3-8B-Instruct",
26
  "rinna/llama-3-youko-8b",
27
- "rinna/japanese-gpt-neox-3.6b"
28
  ]
29
  list_llm_simple = [os.path.basename(llm) for llm in list_llm]
30
 
@@ -240,4 +246,4 @@ def demo():
240
  return demo
241
 
242
  if __name__ == "__main__":
243
- demo().launch(server_name="0.0.0.0", server_port=8188)
 
12
  pipeline,
13
  BitsAndBytesConfig
14
  )
15
+ from langchain_community.vectorstores import FAISS # 修正
16
  from langchain.chains import ConversationalRetrievalChain
17
  from langchain.memory import ConversationBufferMemory
18
+ from langchain_community.llms import HuggingFacePipeline # 修正
19
+ from langchain_community.embeddings import HuggingFaceEmbeddings # 修正
20
  from langchain_huggingface import HuggingFaceEndpoint
21
 
22
+ # Pydanticの警告を無視
23
+ import warnings
24
+ warnings.filterwarnings(
25
+ "ignore",
26
+ message=r"Field \"model_name\" in HuggingFaceInferenceAPIEmbeddings has conflict with protected namespace"
27
+ )
28
+
29
  load_dotenv()
30
 
31
  list_llm = [
32
  "meta-llama/Meta-Llama-3-8B-Instruct",
33
  "rinna/llama-3-youko-8b",
 
34
  ]
35
  list_llm_simple = [os.path.basename(llm) for llm in list_llm]
36
 
 
246
  return demo
247
 
248
  if __name__ == "__main__":
249
+ demo().launch()
requirements.txt CHANGED
@@ -16,4 +16,5 @@ accelerate==0.34.2
16
  python-dotenv==1.0.1
17
  bitsandbytes==0.42.0
18
  fugashi==1.3.2
19
- ipadic==1.0.0
 
 
16
  python-dotenv==1.0.1
17
  bitsandbytes==0.42.0
18
  fugashi==1.3.2
19
+ ipadic==1.0.0
20
+ sentencepiece==0.2.0