Skip to content

Commit

Permalink
[ERROR]
Browse files Browse the repository at this point in the history
  • Loading branch information
Kye committed Apr 16, 2024
1 parent 2edf0e8 commit 95767ae
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion text_to_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,12 @@ def text_to_video(
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(
base, motion_adapter=adapter, torch_dtype=dtype
).to(device)


pipe.scheduler = EulerDiscreteScheduler.from_config(
pipe.scheduler.config,
timestep_spacing="trailing",
Expand Down Expand Up @@ -109,7 +112,12 @@ async def create_chat_completion(
)

logger.info(f"Running text_to_video model with params: {gen_params}")
response = text_to_video(**gen_params)

try:
response = text_to_video(**gen_params)
except Exception as e:
logger.error(f"Error: {e}")
raise HTTPException(status_code=500, detail="Internal Server Error")

out = TextToVideoResponse(
status="success",
Expand Down

0 comments on commit 95767ae

Please sign in to comment.