nsthorat commited on
Commit
81f7253
1 Parent(s): 4be3a82
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .dockerignore +10 -0
  2. .env +3 -0
  3. src/__pycache__/__init__.cpython-39.pyc +0 -0
  4. src/__pycache__/config.cpython-39.pyc +0 -0
  5. src/__pycache__/conftest.cpython-39-pytest-7.3.1.pyc +0 -0
  6. src/__pycache__/conftest.cpython-39-pytest-7.4.0.pyc +0 -0
  7. src/__pycache__/constants.cpython-39.pyc +0 -0
  8. src/__pycache__/data_loader.cpython-39.pyc +0 -0
  9. src/__pycache__/data_loader_test.cpython-39-pytest-7.3.1.pyc +0 -0
  10. src/__pycache__/data_loader_test.cpython-39-pytest-7.4.0.pyc +0 -0
  11. src/__pycache__/db_deprecated.cpython-39.pyc +0 -0
  12. src/__pycache__/db_manager.cpython-39.pyc +0 -0
  13. src/__pycache__/json_encoder.cpython-39.pyc +0 -0
  14. src/__pycache__/make_api.cpython-39.pyc +0 -0
  15. src/__pycache__/make_openapi.cpython-39.pyc +0 -0
  16. src/__pycache__/parquet_writer.cpython-39.pyc +0 -0
  17. src/__pycache__/router_concept.cpython-39.pyc +0 -0
  18. src/__pycache__/router_data_loader.cpython-39.pyc +0 -0
  19. src/__pycache__/router_dataset.cpython-39.pyc +0 -0
  20. src/__pycache__/router_dataset_manager.cpython-39.pyc +0 -0
  21. src/__pycache__/router_embed_fn.cpython-39.pyc +0 -0
  22. src/__pycache__/router_embedding.cpython-39.pyc +0 -0
  23. src/__pycache__/router_signal.cpython-39.pyc +0 -0
  24. src/__pycache__/router_tasks.cpython-39.pyc +0 -0
  25. src/__pycache__/router_utils.cpython-39.pyc +0 -0
  26. src/__pycache__/schema.cpython-39-pytest-7.2.2.pyc +0 -0
  27. src/__pycache__/schema.cpython-39.pyc +0 -0
  28. src/__pycache__/schema_test.cpython-39-pytest-7.2.2.pyc +0 -0
  29. src/__pycache__/schema_test.cpython-39-pytest-7.3.1.pyc +0 -0
  30. src/__pycache__/schema_test.cpython-39-pytest-7.4.0.pyc +0 -0
  31. src/__pycache__/server.cpython-39.pyc +0 -0
  32. src/__pycache__/server_api.cpython-39.pyc +0 -0
  33. src/__pycache__/server_concept_test.cpython-39-pytest-7.3.1.pyc +0 -0
  34. src/__pycache__/server_concept_test.cpython-39-pytest-7.4.0.pyc +0 -0
  35. src/__pycache__/server_concepts_test.cpython-39-pytest-7.3.1.pyc +0 -0
  36. src/__pycache__/server_test.cpython-39-pytest-7.2.2.pyc +0 -0
  37. src/__pycache__/server_test.cpython-39-pytest-7.3.1.pyc +0 -0
  38. src/__pycache__/server_test.cpython-39-pytest-7.4.0.pyc +0 -0
  39. src/__pycache__/tasks.cpython-39.pyc +0 -0
  40. src/__pycache__/tasks_test.cpython-39-pytest-7.2.2.pyc +0 -0
  41. src/__pycache__/tasks_test.cpython-39-pytest-7.3.1.pyc +0 -0
  42. src/__pycache__/test_utils.cpython-39-pytest-7.2.2.pyc +0 -0
  43. src/__pycache__/test_utils.cpython-39-pytest-7.3.1.pyc +0 -0
  44. src/__pycache__/test_utils.cpython-39-pytest-7.4.0.pyc +0 -0
  45. src/__pycache__/utils.cpython-39.pyc +0 -0
  46. src/server.py +27 -27
  47. web/blueprint/build/_app/immutable/chunks/{ConceptView.4cac775f.js → ConceptView.aac099b5.js} +0 -0
  48. web/blueprint/build/_app/immutable/chunks/navigation.4a0e612e.js +0 -1
  49. web/blueprint/build/_app/immutable/chunks/navigation.6aaae227.js +1 -0
  50. web/blueprint/build/_app/immutable/chunks/{singletons.8070b87f.js → singletons.f0ce81ce.js} +1 -1
.dockerignore ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ # Python
2
+ **/__pycache__
3
+ **/*.pyc
4
+ **/*.pyo
5
+ **/*.pyd
6
+ # Ignore unit tests.
7
+ **/*_test.py
8
+
9
+ # Mac OS.
10
+ .DS_Store
.env CHANGED
@@ -26,3 +26,6 @@ DUCKDB_USE_VIEWS=0
26
 
27
  # The repo to use for the huggingface demo.
28
  # HF_STAGING_DEMO_REPO='HF_ORG/HF_REPO_NAME'
 
 
 
 
26
 
27
  # The repo to use for the huggingface demo.
28
  # HF_STAGING_DEMO_REPO='HF_ORG/HF_REPO_NAME'
29
+
30
+ # To sync data from huggingface before the server boots.
31
+ # LILAC_DL_DATA_FROM_HF_SPACE='HF_ORG/HF_REPO_NAME'
src/__pycache__/__init__.cpython-39.pyc ADDED
Binary file (129 Bytes). View file
 
src/__pycache__/config.cpython-39.pyc ADDED
Binary file (611 Bytes). View file
 
src/__pycache__/conftest.cpython-39-pytest-7.3.1.pyc ADDED
Binary file (1.41 kB). View file
 
src/__pycache__/conftest.cpython-39-pytest-7.4.0.pyc ADDED
Binary file (1.41 kB). View file
 
src/__pycache__/constants.cpython-39.pyc ADDED
Binary file (395 Bytes). View file
 
src/__pycache__/data_loader.cpython-39.pyc ADDED
Binary file (4.39 kB). View file
 
src/__pycache__/data_loader_test.cpython-39-pytest-7.3.1.pyc ADDED
Binary file (4.35 kB). View file
 
src/__pycache__/data_loader_test.cpython-39-pytest-7.4.0.pyc ADDED
Binary file (4.35 kB). View file
 
src/__pycache__/db_deprecated.cpython-39.pyc ADDED
Binary file (9.11 kB). View file
 
src/__pycache__/db_manager.cpython-39.pyc ADDED
Binary file (1.36 kB). View file
 
src/__pycache__/json_encoder.cpython-39.pyc ADDED
Binary file (1.94 kB). View file
 
src/__pycache__/make_api.cpython-39.pyc ADDED
Binary file (1.06 kB). View file
 
src/__pycache__/make_openapi.cpython-39.pyc ADDED
Binary file (1.02 kB). View file
 
src/__pycache__/parquet_writer.cpython-39.pyc ADDED
Binary file (3.06 kB). View file
 
src/__pycache__/router_concept.cpython-39.pyc ADDED
Binary file (7.57 kB). View file
 
src/__pycache__/router_data_loader.cpython-39.pyc ADDED
Binary file (2.97 kB). View file
 
src/__pycache__/router_dataset.cpython-39.pyc ADDED
Binary file (10.5 kB). View file
 
src/__pycache__/router_dataset_manager.cpython-39.pyc ADDED
Binary file (6.12 kB). View file
 
src/__pycache__/router_embed_fn.cpython-39.pyc ADDED
Binary file (1.27 kB). View file
 
src/__pycache__/router_embedding.cpython-39.pyc ADDED
Binary file (1.31 kB). View file
 
src/__pycache__/router_signal.cpython-39.pyc ADDED
Binary file (1.93 kB). View file
 
src/__pycache__/router_tasks.cpython-39.pyc ADDED
Binary file (585 Bytes). View file
 
src/__pycache__/router_utils.cpython-39.pyc ADDED
Binary file (1.31 kB). View file
 
src/__pycache__/schema.cpython-39-pytest-7.2.2.pyc ADDED
Binary file (14 kB). View file
 
src/__pycache__/schema.cpython-39.pyc ADDED
Binary file (15.7 kB). View file
 
src/__pycache__/schema_test.cpython-39-pytest-7.2.2.pyc ADDED
Binary file (9.41 kB). View file
 
src/__pycache__/schema_test.cpython-39-pytest-7.3.1.pyc ADDED
Binary file (9.4 kB). View file
 
src/__pycache__/schema_test.cpython-39-pytest-7.4.0.pyc ADDED
Binary file (9.4 kB). View file
 
src/__pycache__/server.cpython-39.pyc ADDED
Binary file (3.77 kB). View file
 
src/__pycache__/server_api.cpython-39.pyc ADDED
Binary file (4.46 kB). View file
 
src/__pycache__/server_concept_test.cpython-39-pytest-7.3.1.pyc ADDED
Binary file (19.2 kB). View file
 
src/__pycache__/server_concept_test.cpython-39-pytest-7.4.0.pyc ADDED
Binary file (19.2 kB). View file
 
src/__pycache__/server_concepts_test.cpython-39-pytest-7.3.1.pyc ADDED
Binary file (141 Bytes). View file
 
src/__pycache__/server_test.cpython-39-pytest-7.2.2.pyc ADDED
Binary file (8.39 kB). View file
 
src/__pycache__/server_test.cpython-39-pytest-7.3.1.pyc ADDED
Binary file (12.5 kB). View file
 
src/__pycache__/server_test.cpython-39-pytest-7.4.0.pyc ADDED
Binary file (12.5 kB). View file
 
src/__pycache__/tasks.cpython-39.pyc ADDED
Binary file (9.66 kB). View file
 
src/__pycache__/tasks_test.cpython-39-pytest-7.2.2.pyc ADDED
Binary file (2.91 kB). View file
 
src/__pycache__/tasks_test.cpython-39-pytest-7.3.1.pyc ADDED
Binary file (2.91 kB). View file
 
src/__pycache__/test_utils.cpython-39-pytest-7.2.2.pyc ADDED
Binary file (889 Bytes). View file
 
src/__pycache__/test_utils.cpython-39-pytest-7.3.1.pyc ADDED
Binary file (1.1 kB). View file
 
src/__pycache__/test_utils.cpython-39-pytest-7.4.0.pyc ADDED
Binary file (1.1 kB). View file
 
src/__pycache__/utils.cpython-39.pyc ADDED
Binary file (9.63 kB). View file
 
src/server.py CHANGED
@@ -62,33 +62,33 @@ app.mount('/', StaticFiles(directory=os.path.join(DIST_PATH), html=True, check_d
62
  def startup() -> None:
63
  """Download dataset files from the HF space that is uploaded before building the image."""
64
  # Setup.
65
- repo_id = 'lilacai/nikhil_staging'
66
-
67
- # Download the huggingface space data. This includes code and datasets, so we move the datasets
68
- # alone to the data directory.
69
- spaces_download_dir = os.path.join(data_path(), '.hf-spaces', repo_id)
70
- snapshot_download(
71
- repo_id=repo_id,
72
- repo_type='space',
73
- local_dir=spaces_download_dir,
74
- local_dir_use_symlinks=False,
75
- token=CONFIG['HF_ACCESS_TOKEN'])
76
-
77
- datasets = list_datasets(os.path.join(spaces_download_dir, 'data'))
78
- print('datasets: ', datasets)
79
- for dataset in datasets:
80
- dataset_output_dir = get_dataset_output_dir(data_path(), dataset.namespace,
81
- dataset.dataset_name)
82
-
83
- shutil.rmtree(dataset_output_dir, ignore_errors=True)
84
- print('~~~~moving', os.path.join(spaces_download_dir, dataset.namespace, dataset.dataset_name),
85
- 'to', dataset_output_dir)
86
- shutil.move(
87
- os.path.join(spaces_download_dir, dataset.namespace, dataset.dataset_name),
88
- dataset_output_dir)
89
-
90
- run('ls -al')
91
- run(f'ls {data_path()}')
92
 
93
 
94
  def run(cmd: str) -> subprocess.CompletedProcess[bytes]:
 
62
  def startup() -> None:
63
  """Download dataset files from the HF space that is uploaded before building the image."""
64
  # Setup.
65
+ repo_id = CONFIG.get('LILAC_DL_DATA_FROM_HF_SPACE', None)
66
+
67
+ if repo_id:
68
+ # Download the huggingface space data. This includes code and datasets, so we move the datasets
69
+ # alone to the data directory.
70
+ spaces_download_dir = os.path.join(data_path(), '.hf-spaces', repo_id)
71
+ snapshot_download(
72
+ repo_id=repo_id,
73
+ repo_type='space',
74
+ local_dir=spaces_download_dir,
75
+ local_dir_use_symlinks=False,
76
+ token=CONFIG['HF_ACCESS_TOKEN'])
77
+
78
+ datasets = list_datasets(os.path.join(spaces_download_dir, 'data'))
79
+ for dataset in datasets:
80
+ spaces_dataset_output_dir = get_dataset_output_dir(
81
+ os.path.join(spaces_download_dir, 'data'), dataset.namespace, dataset.dataset_name)
82
+ persistent_output_dir = get_dataset_output_dir(data_path(), dataset.namespace,
83
+ dataset.dataset_name)
84
+
85
+ shutil.rmtree(persistent_output_dir, ignore_errors=True)
86
+ print('~~~~moving', os.path.join(spaces_download_dir, dataset.namespace,
87
+ dataset.dataset_name), 'to', persistent_output_dir)
88
+ shutil.move(spaces_dataset_output_dir, persistent_output_dir)
89
+
90
+ run('ls -al')
91
+ run(f'ls {data_path()}')
92
 
93
 
94
  def run(cmd: str) -> subprocess.CompletedProcess[bytes]:
web/blueprint/build/_app/immutable/chunks/{ConceptView.4cac775f.js → ConceptView.aac099b5.js} RENAMED
The diff for this file is too large to render. See raw diff
 
web/blueprint/build/_app/immutable/chunks/navigation.4a0e612e.js DELETED
@@ -1 +0,0 @@
1
- import{j as o}from"./singletons.8070b87f.js";const e=o("goto");export{e as g};
 
 
web/blueprint/build/_app/immutable/chunks/navigation.6aaae227.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{j as o}from"./singletons.f0ce81ce.js";const e=o("goto");export{e as g};
web/blueprint/build/_app/immutable/chunks/{singletons.8070b87f.js → singletons.f0ce81ce.js} RENAMED
@@ -1 +1 @@
1
- import{w as u}from"./index.5884c3e8.js";var p;const k=((p=globalThis.__sveltekit_1jog67w)==null?void 0:p.base)??"";var g;const w=((g=globalThis.__sveltekit_1jog67w)==null?void 0:g.assets)??k,m="1688697326230",T="sveltekit:snapshot",y="sveltekit:scroll",I="sveltekit:index",f={tap:1,hover:2,viewport:3,eager:4,off:-1};function S(e){let t=e.baseURI;if(!t){const n=e.getElementsByTagName("base");t=n.length?n[0].href:e.URL}return t}function x(){return{x:pageXOffset,y:pageYOffset}}function c(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const d={...f,"":f.hover};function h(e){let t=e.assignedSlot??e.parentNode;return(t==null?void 0:t.nodeType)===11&&(t=t.host),t}function O(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=h(e)}}function U(e,t){let n;try{n=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI)}catch{}const a=e instanceof SVGAElement?e.target.baseVal:e.target,r=!n||!!a||A(n,t)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),l=(n==null?void 0:n.origin)===location.origin&&e.hasAttribute("download");return{url:n,external:r,target:a,download:l}}function j(e){let t=null,n=null,a=null,r=null,l=null,o=null,s=e;for(;s&&s!==document.documentElement;)a===null&&(a=c(s,"preload-code")),r===null&&(r=c(s,"preload-data")),t===null&&(t=c(s,"keepfocus")),n===null&&(n=c(s,"noscroll")),l===null&&(l=c(s,"reload")),o===null&&(o=c(s,"replacestate")),s=h(s);function i(v){switch(v){case"":case"true":return!0;case"off":case"false":return!1;default:return null}}return{preload_code:d[a??"off"],preload_data:d[r??"off"],keep_focus:i(t),noscroll:i(n),reload:i(l),replace_state:i(o)}}function _(e){const t=u(e);let n=!0;function a(){n=!0,t.update(o=>o)}function r(o){n=!1,t.set(o)}function l(o){let s;return t.subscribe(i=>{(s===void 0||n&&i!==s)&&o(s=i)})}return{notify:a,set:r,subscribe:l}}function E(){const{set:e,subscribe:t}=u(!1);let n;async function a(){clearTimeout(n);try{const r=await fetch(`${w}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!r.ok)return!1;const o=(await r.json()).version!==m;return o&&(e(!0),clearTimeout(n)),o}catch{return!1}}return{subscribe:t,check:a}}function A(e,t){return e.origin!==location.origin||!e.pathname.startsWith(t)}let b;function L(e){b=e.client}function N(e){return(...t)=>b[e](...t)}const P={url:_({}),page:_({}),navigating:u(null),updated:E()};export{I,f as P,y as S,T as a,U as b,j as c,x as d,k as e,O as f,S as g,L as h,A as i,N as j,P as s};
 
1
+ import{w as u}from"./index.5884c3e8.js";var p;const k=((p=globalThis.__sveltekit_12no3nh)==null?void 0:p.base)??"";var h;const m=((h=globalThis.__sveltekit_12no3nh)==null?void 0:h.assets)??k,w="1688698229991",T="sveltekit:snapshot",y="sveltekit:scroll",I="sveltekit:index",f={tap:1,hover:2,viewport:3,eager:4,off:-1};function S(e){let t=e.baseURI;if(!t){const n=e.getElementsByTagName("base");t=n.length?n[0].href:e.URL}return t}function x(){return{x:pageXOffset,y:pageYOffset}}function c(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const d={...f,"":f.hover};function g(e){let t=e.assignedSlot??e.parentNode;return(t==null?void 0:t.nodeType)===11&&(t=t.host),t}function O(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=g(e)}}function U(e,t){let n;try{n=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI)}catch{}const a=e instanceof SVGAElement?e.target.baseVal:e.target,r=!n||!!a||A(n,t)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),l=(n==null?void 0:n.origin)===location.origin&&e.hasAttribute("download");return{url:n,external:r,target:a,download:l}}function L(e){let t=null,n=null,a=null,r=null,l=null,o=null,s=e;for(;s&&s!==document.documentElement;)a===null&&(a=c(s,"preload-code")),r===null&&(r=c(s,"preload-data")),t===null&&(t=c(s,"keepfocus")),n===null&&(n=c(s,"noscroll")),l===null&&(l=c(s,"reload")),o===null&&(o=c(s,"replacestate")),s=g(s);function i(v){switch(v){case"":case"true":return!0;case"off":case"false":return!1;default:return null}}return{preload_code:d[a??"off"],preload_data:d[r??"off"],keep_focus:i(t),noscroll:i(n),reload:i(l),replace_state:i(o)}}function _(e){const t=u(e);let n=!0;function a(){n=!0,t.update(o=>o)}function r(o){n=!1,t.set(o)}function l(o){let s;return t.subscribe(i=>{(s===void 0||n&&i!==s)&&o(s=i)})}return{notify:a,set:r,subscribe:l}}function E(){const{set:e,subscribe:t}=u(!1);let n;async function a(){clearTimeout(n);try{const r=await fetch(`${m}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!r.ok)return!1;const o=(await r.json()).version!==w;return o&&(e(!0),clearTimeout(n)),o}catch{return!1}}return{subscribe:t,check:a}}function A(e,t){return e.origin!==location.origin||!e.pathname.startsWith(t)}let b;function N(e){b=e.client}function P(e){return(...t)=>b[e](...t)}const V={url:_({}),page:_({}),navigating:u(null),updated:E()};export{I,f as P,y as S,T as a,U as b,L as c,x as d,k as e,O as f,S as g,N as h,A as i,P as j,V as s};