unknown commited on
Commit
041332b
Β·
1 Parent(s): 131b802

Added requirements and removed Device for CPU only

Browse files
Files changed (1) hide show
  1. app.py +10 -9
app.py CHANGED
@@ -35,11 +35,13 @@ def main():
35
 
36
  # Title and description
37
  st.title("πŸ—Ό Lutece-Vision-Base Demo")
38
- st.markdown("Upload a financial document and ask questions about it!")
39
 
40
- # Sidebar with SujetAI watermark
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
- # Answer section spanning both columns
67
- if submit_button and question:
68
- with st.spinner("Generating answer..."):
69
- answer = generate_answer(model, processor, image, question)
70
- st.success("Answer generated!")
71
- st.markdown(f"## πŸ’‘ Answer")
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()