import gradio as gr import os from crewai import Crew, Process # from agents import * from agents import get_agents_and_tasks def generate_video(topic, stability_ai_api_key):#, openai_api_key): # os.environ['GROQ_API_KEY'] = grow_api_key os.environ['STABILITY_AI_API_KEY'] = stability_ai_api_key # os.environ['OPENAI_API_KEY'] = openai_api_key grow_api_key = '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' agents, tasks = get_agents_and_tasks(grow_api_key) crew = Crew( # agents=[script_agent, image_descriptive_agent, img_speech_generating_agent, editor], # tasks=[content_generation_task, story_writing_task, img_text_task, img_generation_task,speech_generation_task,make_video_task], agents = agents, tasks = tasks, process = Process.sequential, # cache = True, # memory=True, verbose=2 ) result = crew.kickoff(inputs={'topic': topic}) return result # app = gr.Interface( # fn=generate_video, # inputs=['text', 'text'], # # outputs=gr.Video(value=os.path.join('outputs/final_video/video.mp4'),label="Generated Video", width=720/2, height=1280/2), # outputs = gr.Video(format='mp4',label="Generated Video", width=720/2, height=1280/2), # title="ShortsIn", # description="Shorts generator" # ) intro = """