jbilcke-hf HF staff commited on
Commit
6789b6e
1 Parent(s): 6941871

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +7 -3
handler.py CHANGED
@@ -7,12 +7,12 @@ import io
7
  import logging
8
  import random
9
  import traceback
10
-
11
  import numpy as np
12
  import torch
13
  from diffusers import LTXPipeline, LTXImageToVideoPipeline
14
  from PIL import Image
15
- from varnish import Varnish
16
 
17
  # Configure logging
18
  logging.basicConfig(level=logging.INFO)
@@ -85,13 +85,17 @@ class EndpointHandler:
85
  #self.text_to_video.enable_model_cpu_offload()
86
  #self.image_to_video.enable_model_cpu_offload()
87
 
 
 
 
88
  # Initialize Varnish for post-processing
89
  self.varnish = Varnish(
90
  device="cuda" if torch.cuda.is_available() else "cpu",
91
  output_format="mp4",
92
  output_codec="h264",
93
  output_quality=23,
94
- enable_mmaudio=False
 
95
  )
96
 
97
  async def process_frames(
 
7
  import logging
8
  import random
9
  import traceback
10
+ import os
11
  import numpy as np
12
  import torch
13
  from diffusers import LTXPipeline, LTXImageToVideoPipeline
14
  from PIL import Image
15
+ from varnish import Varnish, setup_debug_logging
16
 
17
  # Configure logging
18
  logging.basicConfig(level=logging.INFO)
 
85
  #self.text_to_video.enable_model_cpu_offload()
86
  #self.image_to_video.enable_model_cpu_offload()
87
 
88
+ # temporary enable this if you have some issues with locating the model files
89
+ setup_debug_logging()
90
+
91
  # Initialize Varnish for post-processing
92
  self.varnish = Varnish(
93
  device="cuda" if torch.cuda.is_available() else "cpu",
94
  output_format="mp4",
95
  output_codec="h264",
96
  output_quality=23,
97
+ enable_mmaudio=False,
98
+ #model_base_dir=os.path.abspath(os.path.join(os.getcwd(), "varnish"))
99
  )
100
 
101
  async def process_frames(