diff --git a/.gitignore b/.gitignore index ae54f51..9a5b0b4 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -api/checkpoints \ No newline at end of file +checkpoints \ No newline at end of file diff --git a/api/client.py b/api/client.py new file mode 100644 index 0000000..12b71e5 --- /dev/null +++ b/api/client.py @@ -0,0 +1,18 @@ + +# Copyright The Lightning AI team. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import requests + +response = requests.post("http://127.0.0.1:8000/predict", json={"input": 4.0}) +print(f"Status: {response.status_code}\nResponse:\n {response.text}") diff --git a/api/logs/ltx_api.log b/api/logs/ltx_api.log index 08fe168..a153028 100644 --- a/api/logs/ltx_api.log +++ b/api/logs/ltx_api.log @@ -23,3 +23,10 @@ 2024-11-28 19:09:10.161 | INFO | __main__:main:348 - Starting LTX video generation server on port 8000 2024-11-28 19:11:22.845 | INFO | __main__:main:356 - Starting LTX video generation server on port 8000 2024-11-28 19:13:03.394 | INFO | __main__:main:356 - Starting LTX video generation server on port 8000 +2024-12-16 12:54:28.451 | INFO | __main__:main:356 - Starting LTX video generation server on port 8000 +2024-12-16 12:58:14.459 | ERROR | __main__:main:360 - Server failed to start: One or more workers failed to start. Shutting down LitServe +2024-12-16 12:59:43.351 | INFO | __main__:main:356 - Starting LTX video generation server on port 8000 +2024-12-16 12:59:46.614 | ERROR | __main__:main:360 - Server failed to start: One or more workers failed to start. Shutting down LitServe +2024-12-16 13:00:02.774 | INFO | __main__:main:356 - Starting LTX video generation server on port 8000 +2024-12-16 13:03:49.870 | ERROR | __main__:main:360 - Server failed to start: One or more workers failed to start. Shutting down LitServe +2024-12-16 13:15:44.243 | INFO | __main__:main:356 - Starting LTX video generation server on port 8000 diff --git a/configs/__pycache__/aws_settings.cpython-311.pyc b/configs/__pycache__/aws_settings.cpython-311.pyc index 83c4635..0cc3224 100644 Binary files a/configs/__pycache__/aws_settings.cpython-311.pyc and b/configs/__pycache__/aws_settings.cpython-311.pyc differ diff --git a/configs/__pycache__/ltx_settings.cpython-311.pyc b/configs/__pycache__/ltx_settings.cpython-311.pyc index edb7680..7cf30e7 100644 Binary files a/configs/__pycache__/ltx_settings.cpython-311.pyc and b/configs/__pycache__/ltx_settings.cpython-311.pyc differ diff --git a/configs/ltx_settings.py b/configs/ltx_settings.py index bbe0bd5..ea833f8 100644 --- a/configs/ltx_settings.py +++ b/configs/ltx_settings.py @@ -64,6 +64,7 @@ class LTXVideoSettings(BaseSettings): device (str): Device for inference ('cuda' or 'cpu') prompt (Optional[str]): Generation prompt text negative_prompt (str): Negative prompt for undesired features + model_revision (str): Specific model revision to use for stability Example: >>> settings = LTXVideoSettings( @@ -81,7 +82,7 @@ class LTXVideoSettings(BaseSettings): description="HuggingFace model ID" ) ckpt_dir: Path = Field( - default_factory=lambda: Path(os.getenv('LTX_CKPT_DIR', 'checkpoints')), + default_factory=lambda: Path(os.getenv('LTX_CKPT_DIR', '../checkpoints')), description="Directory containing model checkpoints" ) use_auth_token: Optional[str] = Field( @@ -137,6 +138,12 @@ class LTXVideoSettings(BaseSettings): MAX_WIDTH: int = 1280 MAX_NUM_FRAMES: int = 257 + # Add model revision to ensure stable downloads + model_revision: str = Field( + default="f1994f6731091f828ecc135923c978155928c031", + description="Specific model revision to use for stability" + ) + def download_model(self) -> Path: """ Download model from HuggingFace Hub if not already present. @@ -168,10 +175,11 @@ def download_model(self) -> Path: # Create checkpoint directory if it doesn't exist self.ckpt_dir.mkdir(parents=True, exist_ok=True) - # Download model from HuggingFace - logger.info(f"Downloading model {self.model_id} to {self.ckpt_dir}") + # Download model from HuggingFace with specific revision + logger.info(f"Downloading model {self.model_id} (revision: {self.model_revision}) to {self.ckpt_dir}") snapshot_download( repo_id=self.model_id, + revision=self.model_revision, # Use specific working revision local_dir=self.ckpt_dir, local_dir_use_symlinks=False, repo_type='model', diff --git a/ltx b/ltx index e61ec9c..f923c5a 160000 --- a/ltx +++ b/ltx @@ -1 +1 @@ -Subproject commit e61ec9ce9db99aadccc7675f580bd51052c78e0a +Subproject commit f923c5ac147e9f88c1aae336406eb3519b944b4b diff --git a/requirements.txt b/requirements.txt index 2f07b14..b254e97 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,3 +10,4 @@ boto3 prometheus-client loguru bitsandbytes +imageio \ No newline at end of file diff --git a/scripts/__pycache__/ltx_inference.cpython-311.pyc b/scripts/__pycache__/ltx_inference.cpython-311.pyc index 2d3dbce..3edadb0 100644 Binary files a/scripts/__pycache__/ltx_inference.cpython-311.pyc and b/scripts/__pycache__/ltx_inference.cpython-311.pyc differ diff --git a/scripts/__pycache__/mp4_to_s3_json.cpython-311.pyc b/scripts/__pycache__/mp4_to_s3_json.cpython-311.pyc index 08e545f..8d33bd4 100644 Binary files a/scripts/__pycache__/mp4_to_s3_json.cpython-311.pyc and b/scripts/__pycache__/mp4_to_s3_json.cpython-311.pyc differ diff --git a/scripts/__pycache__/s3_manager.cpython-311.pyc b/scripts/__pycache__/s3_manager.cpython-311.pyc index 849370a..ced3b81 100644 Binary files a/scripts/__pycache__/s3_manager.cpython-311.pyc and b/scripts/__pycache__/s3_manager.cpython-311.pyc differ