Nguyen17 commited on
Commit
4873385
·
1 Parent(s): 2cfe79f
Files changed (2) hide show
  1. app.py +6 -2
  2. requirements.txt +10 -10
app.py CHANGED
@@ -13,6 +13,9 @@ from llama_index.core import Prompt, Settings, VectorStoreIndex
13
  from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig, TextStreamer
14
 
15
  import gradio as gr
 
 
 
16
 
17
 
18
 
@@ -145,7 +148,7 @@ def vistral_chat(cfg, retriever, tokenizer, language_model):
145
  # print(20*'---')
146
 
147
 
148
- def main(config_path):
149
  # Configure logging
150
  logging.basicConfig(level=logging.INFO,
151
  format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
@@ -183,10 +186,11 @@ def main(config_path):
183
  logger.exception("An error occurred: %s", e)
184
 
185
  if __name__ == "__main__":
 
186
  parser = argparse.ArgumentParser(description='Process some configurations.')
187
  parser.add_argument('--config', type=str, default='config.yaml', help='Path to the configuration file')
188
  args = parser.parse_args()
189
- main(args.config)
190
 
191
 
192
 
 
13
  from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig, TextStreamer
14
 
15
  import gradio as gr
16
+ from . import prepare_data
17
+ from prepare_data import *
18
+ from prepare_data import main
19
 
20
 
21
 
 
148
  # print(20*'---')
149
 
150
 
151
+ def main1(config_path):
152
  # Configure logging
153
  logging.basicConfig(level=logging.INFO,
154
  format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
 
186
  logger.exception("An error occurred: %s", e)
187
 
188
  if __name__ == "__main__":
189
+ main()
190
  parser = argparse.ArgumentParser(description='Process some configurations.')
191
  parser.add_argument('--config', type=str, default='config.yaml', help='Path to the configuration file')
192
  args = parser.parse_args()
193
+ main1(args.config)
194
 
195
 
196
 
requirements.txt CHANGED
@@ -1,12 +1,12 @@
1
- llama-index==0.10.44
2
- mammoth==1.7.1
3
- python-docx==1.1.2
4
- docx2txt==0.8
5
- langchain-community==0.2.4
6
- sentence-transformers==3.0.1
7
- accelerate==0.31.0
8
- bitsandbytes==0.43.1
9
- langchain-huggingface==0.0.3
10
- jsonargparse==4.29.0
11
  llama-index-embeddings-langchain
12
  gradio
 
1
+ llama-index
2
+ mammoth
3
+ python-docx
4
+ docx2txt
5
+ langchain-community
6
+ sentence-transformers
7
+ accelerate
8
+ bitsandbytes
9
+ langchain-huggingface
10
+ jsonargparse
11
  llama-index-embeddings-langchain
12
  gradio