wifix199 commited on
Commit
97cd03b
·
verified ·
1 Parent(s): 5392ab0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +46 -49
app.py CHANGED
@@ -1,68 +1,65 @@
1
  import gradio as gr
2
 
3
- # Example inference function
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"] # Font as a list
20
  )
21
 
22
  # Create Gradio blocks with custom CSS for enhanced UI
23
  with gr.Blocks(
24
- css="""
 
 
25
  .gradio-container {background-color: #f0f4f8; padding: 20px;}
26
  h1, h2, h3, h4, h5, h6 {color: #4a5568;}
27
- .chat-message {background-color: #edf2f7; border-radius: 8px; padding: 10px;}
28
- """,
29
- ) as chat:
30
- gr.Markdown("### 💬 SuperChat - A Chatbot Interface")
31
- gr.ChatInterface(
32
- fn=model_inference, # Defined above
33
- chatbot=chatbot, # Set to None for now
34
- examples=EXAMPLES, # Example inputs
35
- multimodal=True,
36
- cache_examples=False,
37
- autofocus=False,
38
- concurrency_limit=10,
39
- )
40
 
41
- # Create Gradio blocks with custom CSS for enhanced UI
42
- with gr.Blocks(theme=theme, title="RocketGPT - AI-Powered Chatbot") as demo:
43
- # Define individual tabs
44
- with gr.Blocks() as voice:
45
- gr.Markdown("### 🎙️ Speech Generator")
46
- gr.HTML("<iframe src='https://wifix199-Text-to-speech-LuminaIQ.hf.space' width='100%' height='800px' style='border-radius: 8px;'></iframe>")
 
 
47
 
48
- with gr.Blocks() as image:
49
- gr.Markdown("### 🖼️ Image Generator")
50
- gr.HTML("<iframe src='https://wifix199-Text-to-image-LuminaIQ.hf.space' width='100%' height='800px' style='border-radius: 8px;'></iframe>")
 
 
 
51
 
52
- with gr.Blocks() as video:
53
- gr.Markdown("### 📹 Video Engine")
54
- gr.HTML("<iframe src='https://kingnish-instant-video.hf.space' width='100%' height='800px' style='border-radius: 8px;'></iframe>")
 
 
 
55
 
56
- with gr.Blocks() as tryon:
57
- gr.Markdown("### 🖼️ Finegrain")
58
- gr.HTML("<iframe src='https://finegrain-finegrain-object-cutter.hf.space' width='100%' height='800px' style='border-radius: 8px;'></iframe>")
 
 
 
59
 
60
- # Create a tabbed interface
61
- gr.TabbedInterface(
62
- interface_list=[chat, voice, image, video, tryon],
63
- tab_names=["💬 SuperChat", "🗣️ Speech Generator", "🖼️ Image Generator", "🎥 Video Generator", "🖼️ Finegrain"]
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)