Spaces:
Sleeping
Sleeping
Try streamlit
Browse files- fe/app.py +20 -0
- requirements.txt +1 -1
fe/app.py
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
import requests
|
3 |
+
|
4 |
+
import streamlit as st
|
5 |
+
|
6 |
+
BE = os.getenv("be_url")
|
7 |
+
|
8 |
+
|
9 |
+
datasets = requests.get(f"{BE}/v1/datasets", timeout=500).json()
|
10 |
+
|
11 |
+
st.sidebar.title("datasets")
|
12 |
+
ds = st.sidebar.selectbox(datasets)
|
13 |
+
|
14 |
+
query = st.text_input("Enter your search query")
|
15 |
+
|
16 |
+
|
17 |
+
answer = requests.post(f"http://localhost:8080/v1/datasets/{ds}",
|
18 |
+
timeout=5000, json={'query': query} )
|
19 |
+
|
20 |
+
st.text = answer
|
requirements.txt
CHANGED
@@ -10,4 +10,4 @@ faiss-cpu
|
|
10 |
qdrant-client
|
11 |
elasticsearch
|
12 |
sentence_transformers
|
13 |
-
|
|
|
10 |
qdrant-client
|
11 |
elasticsearch
|
12 |
sentence_transformers
|
13 |
+
streamlit
|