File size: 1,693 Bytes
ddaf94c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e9323ba
ddaf94c
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import streamlit as st
import streamlit.components.v1 as components
 
# Define the Hugging Face spaces URLs
urls = {
    "DRAW : Text 2 Img": "https://ehristoforu-dalle-3-xl-lora-v2.hf.space/",
    "RAG : PDF Assistant": "https://cvachet-pdf-chatbot.hf.space/",
    "CONVO 4 : AI Chat": "https://ngebodh-simplechatbot.hf.space/",
    "Parler : Voice Chat": "https://parler-tts-parler-tts-mini.hf.space/"
}

# Title of the app
st.title("ANTI-GPT 🤖")
st.header("AI Multi-Modal Hub")
st.markdown("---")

# Instructions for users
st.markdown("Select a task below to start interacting with the respective model.")

# Define a single row layout with Streamlit columns
cols = st.columns(len(urls))  # Create columns for each option

# Display each task with a button
for i, (task, url) in enumerate(urls.items()):
    with cols[i]:
        if st.button(task, key=task):
            st.session_state.selected_task = task

# Check if a task has been selected
if "selected_task" in st.session_state:
    task = st.session_state.selected_task
    st.subheader(f"{task}")
    st.markdown("---")

    # Embed the Hugging Face space in an iframe with maximum dimensions
    components.html(
        f'''
            <iframe src="{urls[task]}" 
                    style="position:fixed; top:0; left:0; width:100%; height:100%; border:none; margin:0; padding:0; overflow:hidden; z-index:999999;">
            </iframe>
            ''',
        height=800,  # This height is for the Streamlit container; the iframe will take the full window height
        scrolling=True
    )
    

    # Footer
    st.markdown("---")
    st.write("Integrated by Gokulnath, An Open-Source contribution and integration :)")