Spaces:
Runtime error
Runtime error
Nick Canu
commited on
Commit
·
62fdfea
1
Parent(s):
b3de42e
relative path update
Browse files- .gitignore +2 -1
- Home.py +9 -9
- __pycache__/description_generator.cpython-39.pyc +0 -0
- __pycache__/title_generator.cpython-39.pyc +0 -0
.gitignore
CHANGED
@@ -1,3 +1,4 @@
|
|
1 |
Model_Constants.py
|
2 |
venv/
|
3 |
-
Auto-BG_Workspace.code-workspace
|
|
|
|
1 |
Model_Constants.py
|
2 |
venv/
|
3 |
+
Auto-BG_Workspace.code-workspace
|
4 |
+
secrets.toml
|
Home.py
CHANGED
@@ -15,6 +15,7 @@ def application():
|
|
15 |
import gzip
|
16 |
import io
|
17 |
from description_generator import input_manager, model_control
|
|
|
18 |
|
19 |
#UI Session Variables
|
20 |
if 'desc_iter' not in st.session_state:
|
@@ -40,18 +41,16 @@ def application():
|
|
40 |
|
41 |
#non-ui helper functions
|
42 |
#reader code extended from https://gist.github.com/thearn/5424244 for alternate load format
|
43 |
-
def reader(
|
44 |
-
|
45 |
-
f = gzip.GzipFile(fileobj=url_file)
|
46 |
data = f.read()
|
47 |
obj = pickle.loads(data)
|
48 |
f.close()
|
49 |
return obj
|
50 |
|
51 |
-
def token_expand(
|
52 |
nlp = spacy.blank("en")
|
53 |
-
|
54 |
-
f = gzip.GzipFile(fileobj=url_file)
|
55 |
data = f.read()
|
56 |
obj = pickle.loads(data)
|
57 |
f.close()
|
@@ -139,9 +138,10 @@ def application():
|
|
139 |
###Data
|
140 |
@st.cache_data
|
141 |
def fetch_data():
|
142 |
-
|
143 |
-
|
144 |
-
|
|
|
145 |
category_keys = reader("https://github.com/canunj/Auto-BoardGame/blob/main/Persistent_Data/current_keys.gz?raw=true")
|
146 |
return slim_df, search_tokens, vector_df, category_keys
|
147 |
|
|
|
15 |
import gzip
|
16 |
import io
|
17 |
from description_generator import input_manager, model_control
|
18 |
+
from pathlib import Path
|
19 |
|
20 |
#UI Session Variables
|
21 |
if 'desc_iter' not in st.session_state:
|
|
|
41 |
|
42 |
#non-ui helper functions
|
43 |
#reader code extended from https://gist.github.com/thearn/5424244 for alternate load format
|
44 |
+
def reader(path):
|
45 |
+
f = gzip.GzipFile(filename=path)
|
|
|
46 |
data = f.read()
|
47 |
obj = pickle.loads(data)
|
48 |
f.close()
|
49 |
return obj
|
50 |
|
51 |
+
def token_expand(path):
|
52 |
nlp = spacy.blank("en")
|
53 |
+
f = gzip.GzipFile(filename=path)
|
|
|
54 |
data = f.read()
|
55 |
obj = pickle.loads(data)
|
56 |
f.close()
|
|
|
138 |
###Data
|
139 |
@st.cache_data
|
140 |
def fetch_data():
|
141 |
+
#path load solution from https://stackoverflow.com/questions/69768380/share-streamlit-cant-find-pkl-file
|
142 |
+
slim_df = pd.read_parquet(Path(__file__).parent / "Persistent_Data/slim_df.parquet.gzip")
|
143 |
+
search_tokens = token_expand(Path(__file__).parent / "Persistent_Data/token_search.gz")
|
144 |
+
vector_df = pd.read_parquet(Path(__file__).parent / 'Persistent_Data/vector_df.parquet.gzip')
|
145 |
category_keys = reader("https://github.com/canunj/Auto-BoardGame/blob/main/Persistent_Data/current_keys.gz?raw=true")
|
146 |
return slim_df, search_tokens, vector_df, category_keys
|
147 |
|
__pycache__/description_generator.cpython-39.pyc
CHANGED
Binary files a/__pycache__/description_generator.cpython-39.pyc and b/__pycache__/description_generator.cpython-39.pyc differ
|
|
__pycache__/title_generator.cpython-39.pyc
CHANGED
Binary files a/__pycache__/title_generator.cpython-39.pyc and b/__pycache__/title_generator.cpython-39.pyc differ
|
|