Omar Solano commited on
Commit
3b8bb94
1 Parent(s): defa98b

Db to local disk (#42)

Browse files

* copy db from hub to local

* add version to deeplake

* update .gitignore

* add completion time log

* save DB with overwrite=True

* remove time log

Files changed (4) hide show
  1. .gitignore +3 -3
  2. app.py +1 -1
  3. cfg.py +8 -0
  4. requirements.txt +1 -1
.gitignore CHANGED
@@ -162,7 +162,7 @@ cython_debug/
162
  *.zip
163
  deeplake_store/
164
  .DS_Store
165
- __pycache__/
166
- .env
167
- env/
168
  .vscode/
 
 
 
162
  *.zip
163
  deeplake_store/
164
  .DS_Store
165
+
 
 
166
  .vscode/
167
+ evals/
168
+ local_dataset/
app.py CHANGED
@@ -1,6 +1,7 @@
1
  import logging
2
  import os
3
  from typing import Optional
 
4
 
5
  import gradio as gr
6
  import pandas as pd
@@ -146,7 +147,6 @@ def get_answer(history, sources: Optional[list[str]] = None):
146
  display_ui_to_source = {
147
  ui: src for ui, src in zip(AVAILABLE_SOURCES_UI, AVAILABLE_SOURCES)
148
  }
149
-
150
  sources_renamed = [display_ui_to_source[disp] for disp in sources]
151
  completion = buster.process_input(user_input, sources=sources_renamed)
152
 
 
1
  import logging
2
  import os
3
  from typing import Optional
4
+ import time
5
 
6
  import gradio as gr
7
  import pandas as pd
 
147
  display_ui_to_source = {
148
  ui: src for ui, src in zip(AVAILABLE_SOURCES_UI, AVAILABLE_SOURCES)
149
  }
 
150
  sources_renamed = [display_ui_to_source[disp] for disp in sources]
151
  completion = buster.process_input(user_input, sources=sources_renamed)
152
 
cfg.py CHANGED
@@ -8,6 +8,7 @@ from buster.formatters.prompts import PromptFormatter
8
  from buster.retriever import DeepLakeRetriever, Retriever
9
  from buster.tokenizers import GPTTokenizer
10
  from buster.validators import QuestionAnswerValidator, Validator
 
11
 
12
  from utils import init_mongo_db
13
 
@@ -31,6 +32,13 @@ DEEPLAKE_DATASET_PATH = os.getenv(
31
  "DEEPLAKE_DATASET_PATH", f"hub://{DEEPLAKE_ORG}/{DEEPLAKE_DATASET}"
32
  )
33
 
 
 
 
 
 
 
 
34
  logger.info(f"{DEEPLAKE_DATASET_PATH=}")
35
 
36
  example_questions = [
 
8
  from buster.retriever import DeepLakeRetriever, Retriever
9
  from buster.tokenizers import GPTTokenizer
10
  from buster.validators import QuestionAnswerValidator, Validator
11
+ import deeplake
12
 
13
  from utils import init_mongo_db
14
 
 
32
  "DEEPLAKE_DATASET_PATH", f"hub://{DEEPLAKE_ORG}/{DEEPLAKE_DATASET}"
33
  )
34
 
35
+ deeplake.deepcopy(
36
+ DEEPLAKE_DATASET_PATH,
37
+ "local_dataset",
38
+ overwrite=True,
39
+ )
40
+ DEEPLAKE_DATASET_PATH = "local_dataset"
41
+
42
  logger.info(f"{DEEPLAKE_DATASET_PATH=}")
43
 
44
  example_questions = [
requirements.txt CHANGED
@@ -1,3 +1,3 @@
1
  git+https://github.com/jerpint/buster@better-fallback
2
  gradio==3.50.2
3
- deeplake
 
1
  git+https://github.com/jerpint/buster@better-fallback
2
  gradio==3.50.2
3
+ deeplake==3.8.9