From 2edf0e88aec7fd6488b2338a192a7de1644a62de Mon Sep 17 00:00:00 2001 From: Kye Date: Tue, 16 Apr 2024 15:49:35 -0400 Subject: [PATCH] [CLEANUP] --- swarms_cloud/schema/text_to_video.py | 4 ++-- text_to_video.py | 13 +++++-------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/swarms_cloud/schema/text_to_video.py b/swarms_cloud/schema/text_to_video.py index 901129e..26f3907 100644 --- a/swarms_cloud/schema/text_to_video.py +++ b/swarms_cloud/schema/text_to_video.py @@ -25,8 +25,8 @@ class TextToVideoRequest(BaseModel): ) n: int = Field(default=1, example=1, description="Number of videos to generate") output_type: str = Field( - default=".gif", - example=".gif", + default="gif", + example="gif", description="Type of output to be generated, e.g. video, gif, etc.", ) output_path: str = Field( diff --git a/text_to_video.py b/text_to_video.py index 002feb1..edac67d 100644 --- a/text_to_video.py +++ b/text_to_video.py @@ -18,8 +18,6 @@ from swarms_cloud.schema.text_to_video import TextToVideoRequest, TextToVideoResponse -# from exa.structs.parallelize_models_gpus import prepare_model_for_ddp_inference - # Load environment variables from .env file load_dotenv() @@ -65,7 +63,6 @@ def text_to_video( repo = model_name ckpt = f"animatediff_lightning_{inference_steps}step_diffusers.safetensors" base = "emilianJR/epiCRealism" # Choose to your favorite base model. - adapter = MotionAdapter().to(device, dtype) adapter.load_state_dict(load_file(hf_hub_download(repo, ckpt), device=device)) pipe = AnimateDiffPipeline.from_pretrained( @@ -123,11 +120,11 @@ async def create_chat_completion( logger.info(f"Response: {out}") logger.info(f"Downloading the file: {response}") - FileResponse( - path=response, - filename=request.output_path, - media_type="application/octet-stream", - ) + # FileResponse( + # path=response, + # filename=request.output_path, + # media_type="application/octet-stream", + # ) return out except Exception as e: