Spaces:
Sleeping
Sleeping
Deepak Sahu
commited on
Commit
·
69b5f29
1
Parent(s):
d0e60ec
README.md
CHANGED
@@ -161,7 +161,7 @@ MRR = 0.311 implies that there's a good change that the target book will be in r
|
|
161 |
1. I rewrote the snippets from `z_evaluate.py` to `app.py` with minor changes to expriment with view.
|
162 |
2. To make the HF space faster (previously: 234s; **NOW: 15s**) I added `gr.NO_RELOAD` context block in the module files when loading embedding and generation model.
|
163 |
Reference: https://www.gradio.app/guides/developing-faster-with-reload-mode
|
164 |
-
|
165 |
|
166 |
|
167 |
|
|
|
161 |
1. I rewrote the snippets from `z_evaluate.py` to `app.py` with minor changes to expriment with view.
|
162 |
2. To make the HF space faster (previously: 234s; **NOW: 15s**) I added `gr.NO_RELOAD` context block in the module files when loading embedding and generation model.
|
163 |
Reference: https://www.gradio.app/guides/developing-faster-with-reload-mode
|
164 |
+
3. DONT set `debug=True` for gradio in HF space, else it doesn't start.
|
165 |
|
166 |
|
167 |
|
app.py
CHANGED
@@ -12,8 +12,11 @@ N_RECOMMENDS = 5
|
|
12 |
# generator_model = pipeline('text-generation', model=TRAINED_CASUAL_MODEL)
|
13 |
|
14 |
import gradio as gr
|
15 |
-
|
16 |
-
|
|
|
|
|
|
|
17 |
from z_utils import get_dataframe
|
18 |
|
19 |
books_df = get_dataframe(CLEAN_DF_UNIQUE_TITLES)
|
|
|
12 |
# generator_model = pipeline('text-generation', model=TRAINED_CASUAL_MODEL)
|
13 |
|
14 |
import gradio as gr
|
15 |
+
|
16 |
+
if gr.NO_RELOAD:
|
17 |
+
from z_similarity import computes_similarity_w_hypothetical
|
18 |
+
from z_hypothetical_summary import generate_summaries
|
19 |
+
|
20 |
from z_utils import get_dataframe
|
21 |
|
22 |
books_df = get_dataframe(CLEAN_DF_UNIQUE_TITLES)
|