Docfile commited on
Commit
9fee862
Β·
verified Β·
1 Parent(s): d549477

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -1
app.py CHANGED
@@ -27,7 +27,7 @@ from llama_index.llms.langchain import LangChainLLM
27
  from langchain_g4f import G4FLLM
28
 
29
  nest_asyncio.apply()
30
-
31
  documents = SimpleDirectoryReader('data').load_data()
32
  model_kwargs = {'device': 'cpu'}
33
  encode_kwargs = {'normalize_embeddings': True}
@@ -35,6 +35,19 @@ embed_model = HuggingFaceInstructEmbeddings(
35
  model_name="hkunlp/instructor-xl", model_kwargs=model_kwargs,
36
  encode_kwargs=encode_kwargs
37
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  llm= LLM = G4FLLM(
39
  model=models.gpt_35_turbo,
40
  provider=Provider.ChatgptAi,
 
27
  from langchain_g4f import G4FLLM
28
 
29
  nest_asyncio.apply()
30
+ """
31
  documents = SimpleDirectoryReader('data').load_data()
32
  model_kwargs = {'device': 'cpu'}
33
  encode_kwargs = {'normalize_embeddings': True}
 
35
  model_name="hkunlp/instructor-xl", model_kwargs=model_kwargs,
36
  encode_kwargs=encode_kwargs
37
  )
38
+
39
+ """
40
+
41
+ from langchain.embeddings import HuggingFaceInstructEmbeddings
42
+
43
+ model_name = "hkunlp/instructor-large"
44
+ model_kwargs = {'device': 'cpu'}
45
+ encode_kwargs = {'normalize_embeddings': True}
46
+ embed_model = HuggingFaceInstructEmbeddings(
47
+ model_name=model_name,
48
+ model_kwargs=model_kwargs,
49
+ encode_kwargs=encode_kwargs
50
+ )
51
  llm= LLM = G4FLLM(
52
  model=models.gpt_35_turbo,
53
  provider=Provider.ChatgptAi,