Spaces:
Runtime error
Runtime error
Mani Kandan
commited on
Commit
•
9c961fe
1
Parent(s):
55c2187
app added
Browse files
app.py
ADDED
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from ctypes import sizeof
|
2 |
+
import json
|
3 |
+
from re import search
|
4 |
+
from data import get_all
|
5 |
+
from dataset import get_datasets
|
6 |
+
from models import get_models
|
7 |
+
from papers import get_papers
|
8 |
+
import streamlit as st
|
9 |
+
from upload import upload_ipfs
|
10 |
+
#from metamask_component import metamask_component
|
11 |
+
from wallet_connect import wallet_connect
|
12 |
+
import web3
|
13 |
+
from abi.abi import get_contract
|
14 |
+
import requests
|
15 |
+
from streamlit_lottie import st_lottie
|
16 |
+
from streamlit_lottie import st_lottie_spinner
|
17 |
+
import time
|
18 |
+
|
19 |
+
|
20 |
+
st.set_page_config(
|
21 |
+
page_title="PaperswithFVM",
|
22 |
+
layout="wide"
|
23 |
+
)
|
24 |
+
|
25 |
+
def load_lottieurl(url: str):
|
26 |
+
r = requests.get(url)
|
27 |
+
if r.status_code != 200:
|
28 |
+
return None
|
29 |
+
return r.json()
|
30 |
+
|
31 |
+
|
32 |
+
lottie_url_download = "https://assets8.lottiefiles.com/packages/lf20_xhlbndhm.json"
|
33 |
+
lottie_download = load_lottieurl(lottie_url_download)
|
34 |
+
|
35 |
+
col1, col2, col3 = st.columns([1,1.5,1])
|
36 |
+
|
37 |
+
with col1:
|
38 |
+
st.write(' ')
|
39 |
+
with col2:
|
40 |
+
st_lottie(lottie_download, key="hello",width =300)
|
41 |
+
with col3:
|
42 |
+
st.write(' ')
|
43 |
+
|
44 |
+
|
45 |
+
|
46 |
+
|
47 |
+
_, _, _, col, _, _, _ = st.columns([1]*6+[1.18])
|
48 |
+
|
49 |
+
with col:
|
50 |
+
connect_button = wallet_connect(label="wallet", key="wallet")
|
51 |
+
|
52 |
+
if connect_button != 'not':
|
53 |
+
print(connect_button)
|
54 |
+
|
55 |
+
|
56 |
+
# Metamask
|
57 |
+
#value = metamask_component(account_results="hello there")
|
58 |
+
|
59 |
+
#connect_button = wallet_connect(label="wallet", key="wallet")
|
60 |
+
|
61 |
+
|
62 |
+
with st.sidebar:
|
63 |
+
option = st.radio(
|
64 |
+
'Select Category',
|
65 |
+
('All','Papers','Datasets', 'Models', "Upload"))
|
66 |
+
|
67 |
+
|
68 |
+
if option == "Papers":
|
69 |
+
with st.form("form1", clear_on_submit=False):
|
70 |
+
search_word = st.text_input(f'Search here')
|
71 |
+
submit = st.form_submit_button("Submit")
|
72 |
+
if submit:
|
73 |
+
get_papers(search_word)
|
74 |
+
st.balloons()
|
75 |
+
elif option == "Datasets":
|
76 |
+
with st.form("form1", clear_on_submit=False):
|
77 |
+
search_word = st.text_input(f'Search {option} here')
|
78 |
+
submit = st.form_submit_button("Submit")
|
79 |
+
if submit:
|
80 |
+
get_datasets(search_word)
|
81 |
+
st.balloons()
|
82 |
+
elif option == "Models":
|
83 |
+
with st.form("form1", clear_on_submit=False):
|
84 |
+
search_word = st.text_input(f'Search {option} here')
|
85 |
+
submit = st.form_submit_button("Submit")
|
86 |
+
if submit:
|
87 |
+
get_models(search_word)
|
88 |
+
st.balloons()
|
89 |
+
elif option == "Upload":
|
90 |
+
upload_ipfs()
|
91 |
+
|
92 |
+
else:
|
93 |
+
with st.form("form1", clear_on_submit=False):
|
94 |
+
search_word = st.text_input(f'Search {option} here')
|
95 |
+
submit = st.form_submit_button("Submit")
|
96 |
+
if submit:
|
97 |
+
get_all(search_word)
|
98 |
+
st.balloons()
|
99 |
+
|
100 |
+
|
101 |
+
|
102 |
+
|
103 |
+
|
104 |
+
|