Spaces:
Runtime error
Runtime error
ugmSorcero
commited on
Commit
•
b8acde7
1
Parent(s):
0f09d43
Linting
Browse files- core/pipelines.py +2 -4
- interface/components.py +6 -1
- interface/utils.py +2 -0
core/pipelines.py
CHANGED
@@ -141,14 +141,12 @@ def dense_passage_retrieval_ranker(
|
|
141 |
ranker = SentenceTransformersRanker(model_name_or_path=ranker_model)
|
142 |
|
143 |
search_pipeline.add_node(ranker, name="Ranker", inputs=["DPRRetriever"])
|
144 |
-
|
145 |
if audio_output:
|
146 |
doc2speech = DocumentToSpeech(
|
147 |
model_name_or_path="espnet/kan-bayashi_ljspeech_vits",
|
148 |
generated_audio_dir=Path(data_path + "audio"),
|
149 |
)
|
150 |
-
search_pipeline.add_node(
|
151 |
-
doc2speech, name="DocumentToSpeech", inputs=["Ranker"]
|
152 |
-
)
|
153 |
|
154 |
return search_pipeline, index_pipeline
|
|
|
141 |
ranker = SentenceTransformersRanker(model_name_or_path=ranker_model)
|
142 |
|
143 |
search_pipeline.add_node(ranker, name="Ranker", inputs=["DPRRetriever"])
|
144 |
+
|
145 |
if audio_output:
|
146 |
doc2speech = DocumentToSpeech(
|
147 |
model_name_or_path="espnet/kan-bayashi_ljspeech_vits",
|
148 |
generated_audio_dir=Path(data_path + "audio"),
|
149 |
)
|
150 |
+
search_pipeline.add_node(doc2speech, name="DocumentToSpeech", inputs=["Ranker"])
|
|
|
|
|
151 |
|
152 |
return search_pipeline, index_pipeline
|
interface/components.py
CHANGED
@@ -1,5 +1,10 @@
|
|
1 |
import streamlit as st
|
2 |
-
from interface.utils import
|
|
|
|
|
|
|
|
|
|
|
3 |
from interface.draw_pipelines import get_pipeline_graph
|
4 |
|
5 |
|
|
|
1 |
import streamlit as st
|
2 |
+
from interface.utils import (
|
3 |
+
get_pipelines,
|
4 |
+
extract_text_from_url,
|
5 |
+
extract_text_from_file,
|
6 |
+
reset_vars_data,
|
7 |
+
)
|
8 |
from interface.draw_pipelines import get_pipeline_graph
|
9 |
|
10 |
|
interface/utils.py
CHANGED
@@ -25,12 +25,14 @@ def get_pipelines():
|
|
25 |
]
|
26 |
return pipeline_names, pipeline_funcs, pipeline_func_parameters
|
27 |
|
|
|
28 |
def reset_vars_data():
|
29 |
st.session_state["doc_id"] = 0
|
30 |
# Delete data files
|
31 |
shutil.rmtree(data_path)
|
32 |
os.makedirs(data_path, exist_ok=True)
|
33 |
|
|
|
34 |
@st.experimental_memo
|
35 |
def extract_text_from_url(url: str):
|
36 |
article = Article(url)
|
|
|
25 |
]
|
26 |
return pipeline_names, pipeline_funcs, pipeline_func_parameters
|
27 |
|
28 |
+
|
29 |
def reset_vars_data():
|
30 |
st.session_state["doc_id"] = 0
|
31 |
# Delete data files
|
32 |
shutil.rmtree(data_path)
|
33 |
os.makedirs(data_path, exist_ok=True)
|
34 |
|
35 |
+
|
36 |
@st.experimental_memo
|
37 |
def extract_text_from_url(url: str):
|
38 |
article = Article(url)
|