unknown
commited on
Commit
Β·
041332b
1
Parent(s):
131b802
Added requirements and removed Device for CPU only
Browse files
app.py
CHANGED
@@ -35,11 +35,13 @@ def main():
|
|
35 |
|
36 |
# Title and description
|
37 |
st.title("πΌ Lutece-Vision-Base Demo")
|
38 |
-
st.markdown("
|
39 |
|
40 |
-
|
41 |
st.sidebar.image("sujetAI.svg", use_column_width=True)
|
42 |
st.sidebar.markdown("---")
|
|
|
|
|
43 |
st.sidebar.markdown("Our website : [sujet.ai](https://sujet.ai)")
|
44 |
|
45 |
# Load model and processor
|
@@ -63,13 +65,12 @@ def main():
|
|
63 |
question = st.text_input("β Ask a question about the document", "")
|
64 |
submit_button = st.button("π Generate Answer")
|
65 |
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
st.markdown(answer)
|
73 |
|
74 |
if __name__ == "__main__":
|
75 |
main()
|
|
|
35 |
|
36 |
# Title and description
|
37 |
st.title("πΌ Lutece-Vision-Base Demo")
|
38 |
+
st.markdown("Please keep in mind that inference might be slower since this Huggingface space is running on CPU only.")
|
39 |
|
40 |
+
# Sidebar with SujetAI watermark
|
41 |
st.sidebar.image("sujetAI.svg", use_column_width=True)
|
42 |
st.sidebar.markdown("---")
|
43 |
+
st.sidebar.markdown("Sujet AI, a Paris-based AI startup, is on a noble mission to democratize investment opportunities by leveraging built-in models and cutting-edge technologies. Committed to open-sourcing its technology, Sujet AI aims to contribute to the research and development communities, ultimately serving the greater good of humanity.")
|
44 |
+
st.sidebar.markdown("---")
|
45 |
st.sidebar.markdown("Our website : [sujet.ai](https://sujet.ai)")
|
46 |
|
47 |
# Load model and processor
|
|
|
65 |
question = st.text_input("β Ask a question about the document", "")
|
66 |
submit_button = st.button("π Generate Answer")
|
67 |
|
68 |
+
# Answer section spanning both columns
|
69 |
+
if submit_button and question:
|
70 |
+
with st.spinner("Generating answer..."):
|
71 |
+
answer = generate_answer(model, processor, image, question)
|
72 |
+
st.success(f"## π‘ {answer}")
|
73 |
+
|
|
|
74 |
|
75 |
if __name__ == "__main__":
|
76 |
main()
|