File size: 2,493 Bytes
e547b24
5392ab0
 
 
 
 
 
 
 
 
 
 
e547b24
d0338ea
 
 
 
 
5392ab0
d0338ea
adb8560
00dff1b
 
5392ab0
00dff1b
 
 
 
 
5392ab0
00dff1b
5392ab0
 
 
00dff1b
 
 
 
 
 
adb8560
 
8a2ecd4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5392ab0
8a2ecd4
 
 
 
adb8560
 
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import gradio as gr

# Example inference function
def model_inference(message):
    # Example logic for processing user messages
    return f"You said: {message}"

# Example chatbot configuration (if needed)
chatbot = None

# Example inputs
EXAMPLES = ["Hello!", "How are you?", "Tell me a joke."]

# Define Gradio theme
theme = gr.themes.Soft(
    primary_hue="indigo",
    secondary_hue="emerald",
    neutral_hue="gray",
    font=["Rubik"]  # Font as a list
)

# Create Gradio blocks with custom CSS for enhanced UI
with gr.Blocks(
    css=""" 
        .gradio-container {background-color: #f0f4f8; padding: 20px;}
        h1, h2, h3, h4, h5, h6 {color: #4a5568;}
        .chat-message {background-color: #edf2f7; border-radius: 8px; padding: 10px;}
    """,
) as chat:
    gr.Markdown("### 💬 SuperChat - A Chatbot Interface")
    gr.ChatInterface(
        fn=model_inference,  # Defined above
        chatbot=chatbot,  # Set to None for now
        examples=EXAMPLES,  # Example inputs
        multimodal=True,
        cache_examples=False,
        autofocus=False,
        concurrency_limit=10,
    )

# Create Gradio blocks with custom CSS for enhanced UI
with gr.Blocks(theme=theme, title="RocketGPT - AI-Powered Chatbot") as demo:
    # Define individual tabs
    with gr.Blocks() as voice:
        gr.Markdown("### 🎙️ Speech Generator")
        gr.HTML("<iframe src='https://wifix199-Text-to-speech-LuminaIQ.hf.space' width='100%' height='800px' style='border-radius: 8px;'></iframe>")

    with gr.Blocks() as image:
        gr.Markdown("### 🖼️ Image Generator")
        gr.HTML("<iframe src='https://wifix199-Text-to-image-LuminaIQ.hf.space' width='100%' height='800px' style='border-radius: 8px;'></iframe>")

    with gr.Blocks() as video:
        gr.Markdown("### 📹 Video Engine")
        gr.HTML("<iframe src='https://kingnish-instant-video.hf.space' width='100%' height='800px' style='border-radius: 8px;'></iframe>")

    with gr.Blocks() as tryon:
        gr.Markdown("### 🖼️ Finegrain")
        gr.HTML("<iframe src='https://finegrain-finegrain-object-cutter.hf.space' width='100%' height='800px' style='border-radius: 8px;'></iframe>")

    # Create a tabbed interface
    gr.TabbedInterface(
        interface_list=[chat, voice, image, video, tryon],
        tab_names=["💬 SuperChat", "🗣️ Speech Generator", "🖼️ Image Generator", "🎥 Video Generator", "🖼️ Finegrain"]
    )

# Launch the app
demo.queue(max_size=300)
demo.launch()