Gokulnath2003 commited on
Commit
ddaf94c
·
verified ·
1 Parent(s): 565302d

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +48 -0
app.py ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import streamlit.components.v1 as components
3
+
4
+ # Define the Hugging Face spaces URLs
5
+ urls = {
6
+ "DRAW : Text 2 Img": "https://ehristoforu-dalle-3-xl-lora-v2.hf.space/",
7
+ "RAG : PDF Assistant": "https://cvachet-pdf-chatbot.hf.space/",
8
+ "CONVO 4 : AI Chat": "https://ngebodh-simplechatbot.hf.space/",
9
+ "Parler : Voice Chat": "https://parler-tts-parler-tts-mini.hf.space/"
10
+ }
11
+
12
+ # Title of the app
13
+ st.title("ANTI-GPT 🤖")
14
+ st.header("AI Multi-Modal Hub")
15
+ st.markdown("---")
16
+
17
+ # Instructions for users
18
+ st.markdown("Select a task below to start interacting with the respective model.")
19
+
20
+ # Define a single row layout with Streamlit columns
21
+ cols = st.columns(len(urls)) # Create columns for each option
22
+
23
+ # Display each task with a button
24
+ for i, (task, url) in enumerate(urls.items()):
25
+ with cols[i]:
26
+ if st.button(task, key=task):
27
+ st.session_state.selected_task = task
28
+
29
+ # Check if a task has been selected
30
+ if "selected_task" in st.session_state:
31
+ task = st.session_state.selected_task
32
+ st.subheader(f"{task}")
33
+ st.markdown("---")
34
+
35
+ # Embed the Hugging Face space in an iframe with maximum dimensions
36
+ components.html(
37
+ f'''
38
+ <iframe src="{urls[task]}"
39
+ style="position:fixed; top:0; left:0; width:100%; height:100%; border:none; margin:0; padding:0; overflow:hidden; z-index:999999;">
40
+ </iframe>
41
+ ''',
42
+ height=800, # This height is for the Streamlit container; the iframe will take the full window height
43
+ scrolling=True
44
+ )
45
+
46
+ # Footer
47
+ st.markdown("---")
48
+ st.write("Integrated by Gokulnath, An Open-Source contribution and integration :)")