Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -17,7 +17,7 @@ from langchain_community.vectorstores import FAISS
|
|
17 |
from langchain_community.document_loaders import HuggingFaceDatasetLoader
|
18 |
from langchain_community.embeddings import HuggingFaceEmbeddings
|
19 |
|
20 |
-
with st.status("Cargando Aplicaci贸n...") as status:
|
21 |
st.write("Cargando Dataset...")
|
22 |
#Carga de DATASET
|
23 |
dataset_name = "Waflon/FAQ"
|
@@ -50,7 +50,6 @@ with st.status("Cargando Aplicaci贸n...") as status:
|
|
50 |
retriever = db.as_retriever(search_kwargs={"k": 3})
|
51 |
status.update(label="App cargada con exito!", state="complete")
|
52 |
|
53 |
-
with st.status("Cargando Lo restante..."):
|
54 |
st.write("Prompt template...")
|
55 |
prompt_template = """Usa los siguientes fragmentos de contextos para responder una pregunta al final. Por favor sigue las siguientes reglas:
|
56 |
1. Si la pregunta requiere vinculos, por favor retornar solamente las vinculos de los vinculos sin respuesta
|
@@ -87,10 +86,15 @@ with st.status("Cargando Lo restante..."):
|
|
87 |
st.write("Finalizando...")
|
88 |
|
89 |
text = st.text_area('Ingrese su pregunta')
|
|
|
90 |
|
|
|
91 |
if text:
|
92 |
out = pipe(text)
|
93 |
st.write(out)
|
94 |
|
95 |
-
|
96 |
-
|
|
|
|
|
|
|
|
17 |
from langchain_community.document_loaders import HuggingFaceDatasetLoader
|
18 |
from langchain_community.embeddings import HuggingFaceEmbeddings
|
19 |
|
20 |
+
with st.status("Cargando Aplicaci贸n...", explanded=False) as status:
|
21 |
st.write("Cargando Dataset...")
|
22 |
#Carga de DATASET
|
23 |
dataset_name = "Waflon/FAQ"
|
|
|
50 |
retriever = db.as_retriever(search_kwargs={"k": 3})
|
51 |
status.update(label="App cargada con exito!", state="complete")
|
52 |
|
|
|
53 |
st.write("Prompt template...")
|
54 |
prompt_template = """Usa los siguientes fragmentos de contextos para responder una pregunta al final. Por favor sigue las siguientes reglas:
|
55 |
1. Si la pregunta requiere vinculos, por favor retornar solamente las vinculos de los vinculos sin respuesta
|
|
|
86 |
st.write("Finalizando...")
|
87 |
|
88 |
text = st.text_area('Ingrese su pregunta')
|
89 |
+
status.update(label="Finalizado!", state="complete")
|
90 |
|
91 |
+
def main():
|
92 |
if text:
|
93 |
out = pipe(text)
|
94 |
st.write(out)
|
95 |
|
96 |
+
|
97 |
+
|
98 |
+
|
99 |
+
if __name__ == "__main__":
|
100 |
+
main()
|