Skip to content

Commit

Permalink
[CLEANUP]
Browse files Browse the repository at this point in the history
  • Loading branch information
Kye committed Apr 16, 2024
1 parent 2ea9dc1 commit 2edf0e8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
4 changes: 2 additions & 2 deletions swarms_cloud/schema/text_to_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
13 changes: 5 additions & 8 deletions text_to_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 2edf0e8

Please sign in to comment.