enpaiva commited on
Commit
f59adc7
·
verified ·
1 Parent(s): 5df4599

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -33,7 +33,7 @@ llm = Llama(model_path="model.gguf",
33
 
34
  BASE_PATH = "/home/user/app/think-paraguayo-space-aux/"
35
 
36
- DOC_PATH = BASE_PATH+"index"
37
 
38
  print(os.listdir())
39
 
@@ -47,12 +47,12 @@ list_nodes = [node.text for node in nodes]
47
 
48
  print(os.getcwd())
49
 
50
- if os.path.exists(DOC_PATH):
51
- RAG = RAGPretrainedModel.from_index(DOC_PATH)
52
- else:
53
- RAG = RAGPretrainedModel.from_pretrained("AdrienB134/ColBERTv2.0-spanish-mmarcoES")
54
- my_documents = list_nodes
55
- index_path = RAG.index(index_name=DOC_PATH, max_document_length= 100, collection=my_documents)
56
 
57
  # def convert_list_to_dict(lst):
58
  # res_dct = {i: lst[i] for i in range(len(lst))}
@@ -165,7 +165,7 @@ def launcher():
165
  # msg.submit(chat_stream_completion, [msg, chatbot], [msg, chatbot])
166
 
167
 
168
- demo.launch(share=True, inline= False, debug=True)
169
 
170
  if __name__ == "__main__":
171
  launcher()
 
33
 
34
  BASE_PATH = "/home/user/app/think-paraguayo-space-aux/"
35
 
36
+ DOC_PATH = BASE_PATH+"index/"
37
 
38
  print(os.listdir())
39
 
 
47
 
48
  print(os.getcwd())
49
 
50
+ # if os.path.exists(DOC_PATH):
51
+ RAG = RAGPretrainedModel.from_index(DOC_PATH)
52
+ # else:
53
+ # RAG = RAGPretrainedModel.from_pretrained("AdrienB134/ColBERTv2.0-spanish-mmarcoES")
54
+ # my_documents = list_nodes
55
+ # index_path = RAG.index(index_name=DOC_PATH, max_document_length= 100, collection=my_documents)
56
 
57
  # def convert_list_to_dict(lst):
58
  # res_dct = {i: lst[i] for i in range(len(lst))}
 
165
  # msg.submit(chat_stream_completion, [msg, chatbot], [msg, chatbot])
166
 
167
 
168
+ demo.launch()#(share=True, inline= False, debug=True)
169
 
170
  if __name__ == "__main__":
171
  launcher()