Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,31 +1,37 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
# Define Gradio theme
|
| 5 |
theme = gr.themes.Soft(
|
| 6 |
primary_hue="indigo",
|
| 7 |
secondary_hue="emerald",
|
| 8 |
neutral_hue="gray",
|
| 9 |
-
font="Rubik" #
|
| 10 |
)
|
| 11 |
|
| 12 |
# Create Gradio blocks with custom CSS for enhanced UI
|
| 13 |
with gr.Blocks(
|
| 14 |
-
css="""
|
| 15 |
.gradio-container {background-color: #f0f4f8; padding: 20px;}
|
| 16 |
h1, h2, h3, h4, h5, h6 {color: #4a5568;}
|
| 17 |
.chat-message {background-color: #edf2f7; border-radius: 8px; padding: 10px;}
|
| 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 chat:
|
| 24 |
-
gr.Markdown("###
|
| 25 |
gr.ChatInterface(
|
| 26 |
-
fn=model_inference,
|
| 27 |
-
chatbot=chatbot,
|
| 28 |
-
examples=EXAMPLES,
|
| 29 |
multimodal=True,
|
| 30 |
cache_examples=False,
|
| 31 |
autofocus=False,
|
|
@@ -35,10 +41,6 @@ with gr.Blocks(
|
|
| 35 |
# Create Gradio blocks with custom CSS for enhanced UI
|
| 36 |
with gr.Blocks(theme=theme, title="RocketGPT - AI-Powered Chatbot") as demo:
|
| 37 |
# Define individual tabs
|
| 38 |
-
with gr.Blocks() as chat:
|
| 39 |
-
gr.Markdown("### 💬 SuperChat")
|
| 40 |
-
gr.HTML("<iframe src='https://Qwen-QwQ-32B-preview.hf.space' width='100%' height='800px' style='border-radius: 8px;'></iframe>")
|
| 41 |
-
|
| 42 |
with gr.Blocks() as voice:
|
| 43 |
gr.Markdown("### 🎙️ Speech Generator")
|
| 44 |
gr.HTML("<iframe src='https://wifix199-Text-to-speech-LuminaIQ.hf.space' width='100%' height='800px' style='border-radius: 8px;'></iframe>")
|
|
@@ -57,7 +59,7 @@ with gr.Blocks(theme=theme, title="RocketGPT - AI-Powered Chatbot") as demo:
|
|
| 57 |
|
| 58 |
# Create a tabbed interface
|
| 59 |
gr.TabbedInterface(
|
| 60 |
-
interface_list=[chat, voice, image, video, tryon],
|
| 61 |
tab_names=["💬 SuperChat", "🗣️ Speech Generator", "🖼️ Image Generator", "🎥 Video Generator", "🖼️ Finegrain"]
|
| 62 |
)
|
| 63 |
|
|
|
|
| 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,
|
|
|
|
| 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>")
|
|
|
|
| 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 |
|