Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,68 +1,65 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
#
|
4 |
-
def model_inference(message):
|
5 |
-
# Example logic for processing user messages
|
6 |
-
return f"You said: {message}"
|
7 |
-
|
8 |
-
# Example chatbot configuration (if needed)
|
9 |
-
chatbot = None
|
10 |
-
|
11 |
-
# Example inputs
|
12 |
-
EXAMPLES = ["Hello!", "How are you?", "Tell me a joke."]
|
13 |
-
|
14 |
-
# Define Gradio theme
|
15 |
theme = gr.themes.Soft(
|
16 |
primary_hue="indigo",
|
17 |
secondary_hue="emerald",
|
18 |
neutral_hue="gray",
|
19 |
-
font=["Rubik"] #
|
20 |
)
|
21 |
|
22 |
# Create Gradio blocks with custom CSS for enhanced UI
|
23 |
with gr.Blocks(
|
24 |
-
|
|
|
|
|
25 |
.gradio-container {background-color: #f0f4f8; padding: 20px;}
|
26 |
h1, h2, h3, h4, h5, h6 {color: #4a5568;}
|
27 |
-
.
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
examples=EXAMPLES, # Example inputs
|
35 |
-
multimodal=True,
|
36 |
-
cache_examples=False,
|
37 |
-
autofocus=False,
|
38 |
-
concurrency_limit=10,
|
39 |
-
)
|
40 |
|
41 |
-
#
|
42 |
-
with gr.
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
|
|
|
|
47 |
|
48 |
-
|
49 |
-
|
50 |
-
|
|
|
|
|
|
|
51 |
|
52 |
-
|
53 |
-
|
54 |
-
|
|
|
|
|
|
|
55 |
|
56 |
-
|
57 |
-
|
58 |
-
|
|
|
|
|
|
|
59 |
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
|
|
65 |
|
66 |
-
# Launch the app
|
67 |
demo.queue(max_size=300)
|
68 |
-
demo.launch()
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
# Define Gradio theme with valid color shortcuts and custom fonts
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
theme = gr.themes.Soft(
|
5 |
primary_hue="indigo",
|
6 |
secondary_hue="emerald",
|
7 |
neutral_hue="gray",
|
8 |
+
font=["Rubik"] # Correctly passing as a list or using GoogleFont
|
9 |
)
|
10 |
|
11 |
# Create Gradio blocks with custom CSS for enhanced UI
|
12 |
with gr.Blocks(
|
13 |
+
theme=theme,
|
14 |
+
title="RocketGPT - AI-Powered Chatbot",
|
15 |
+
css="""
|
16 |
.gradio-container {background-color: #f0f4f8; padding: 20px;}
|
17 |
h1, h2, h3, h4, h5, h6 {color: #4a5568;}
|
18 |
+
.gradio-container .avatar-container {height: 40px; width: 40px; border-radius: 50%; overflow: hidden;}
|
19 |
+
#duplicate-button {margin: auto; color: white; background: #2d3748; border-radius: 100vh; padding: 8px 16px;}
|
20 |
+
.tab-nav-button {background-color: #e2e8f0; border-radius: 8px;}
|
21 |
+
.tab-nav-button.selected {background-color: #cbd5e0;}
|
22 |
+
"""
|
23 |
+
) as demo:
|
24 |
+
gr.Markdown("# 🚀 RocketGPT - AI-Powered Chatbot")
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
|
26 |
+
# Define individual tabs as separate Blocks
|
27 |
+
with gr.Tabs():
|
28 |
+
with gr.Tab("💬 SuperChat"):
|
29 |
+
gr.HTML("""
|
30 |
+
<iframe src='https://Qwen-QwQ-32B-preview.hf.space'
|
31 |
+
width='100%' height='800px'
|
32 |
+
style='border-radius: 8px; border: none;'></iframe>
|
33 |
+
""")
|
34 |
|
35 |
+
with gr.Tab("🗣️ Speech Generator"):
|
36 |
+
gr.HTML("""
|
37 |
+
<iframe src='https://wifix199-Text-to-speech-LuminaIQ.hf.space'
|
38 |
+
width='100%' height='800px'
|
39 |
+
style='border-radius: 8px; border: none;'></iframe>
|
40 |
+
""")
|
41 |
|
42 |
+
with gr.Tab("🖼️ Image Generator"):
|
43 |
+
gr.HTML("""
|
44 |
+
<iframe src='https://wifix199-Text-to-image-LuminaIQ.hf.space'
|
45 |
+
width='100%' height='800px'
|
46 |
+
style='border-radius: 8px; border: none;'></iframe>
|
47 |
+
""")
|
48 |
|
49 |
+
with gr.Tab("🎥 Video Generator"):
|
50 |
+
gr.HTML("""
|
51 |
+
<iframe src='https://kingnish-instant-video.hf.space'
|
52 |
+
width='100%' height='800px'
|
53 |
+
style='border-radius: 8px; border: none;'></iframe>
|
54 |
+
""")
|
55 |
|
56 |
+
with gr.Tab("🖼️ Finegrain"):
|
57 |
+
gr.HTML("""
|
58 |
+
<iframe src='https://finegrain-finegrain-object-cutter.hf.space'
|
59 |
+
width='100%' height='800px'
|
60 |
+
style='border-radius: 8px; border: none;'></iframe>
|
61 |
+
""")
|
62 |
|
63 |
+
# Launch the app with queue support
|
64 |
demo.queue(max_size=300)
|
65 |
+
demo.launch(server_name="0.0.0.0", server_port=7860, share=True)
|