Spaces:
Runtime error
Runtime error
import gradio as gr | |
import json | |
# Dummy function to simulate the podcast creation | |
def create_podcast(data): | |
data = json.loads(data) | |
# Simulate a successful response | |
if data["user_id"] == 1: | |
return { | |
"data": { | |
"id": 2, | |
}, | |
"success": True, | |
"message": "Podcast created successfully" | |
} | |
# Simulate a failure response | |
else: | |
return { | |
"data": {}, | |
"success": False, | |
"message": "Podcast creation failed" | |
} | |
# Define the input and output interfaces for Gradio | |
input_interface = gr.Interface( | |
fn=create_podcast, | |
inputs="text", | |
outputs="text", | |
title="Podcast Creation", | |
description="Create a podcast", | |
examples=[ | |
["{ \"links\": [\"https://dribbble.com/shots/15045344-Podcast-Platform-UI-Concept-1/attachments/6771120?mode=media\", \"https://dribbble.com/shots/15045344-Podcast-Platform-UI-Concept-1/attachments/6771120?mode=media\", \"https://dribbble.com/shots/15045344-Podcast-Platform-UI-Concept-1/attachments/6771120?mode=media\"], \"user_id\": 1 }"] | |
] | |
) | |
# Run the Gradio app | |
input_interface.launch() | |