Spaces:
Runtime error
Runtime error
File size: 1,183 Bytes
9d3094d 705766f 9d3094d 0bbb2c9 9d3094d |
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 |
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()
|