Commit f6d4fc85 authored by PengGao's avatar PengGao Committed by GitHub
Browse files

style: add ruff isort (#183)

parent 878f5a48
import requests import requests
from loguru import logger from loguru import logger
response = requests.get("http://localhost:8000/v1/service/status") response = requests.get("http://localhost:8000/v1/service/status")
logger.info(response.json()) logger.info(response.json())
......
import requests import requests
from loguru import logger from loguru import logger
url = "http://localhost:8000/v1/tasks/" url = "http://localhost:8000/v1/tasks/"
message = { message = {
......
import requests
from loguru import logger
import random import random
import string import string
import time
import threading import threading
import time
from datetime import datetime from datetime import datetime
import requests
from loguru import logger
from tqdm import tqdm from tqdm import tqdm
......
from loguru import logger from loguru import logger
from post_multi_servers import get_available_urls, process_tasks_async from post_multi_servers import get_available_urls, process_tasks_async
if __name__ == "__main__": if __name__ == "__main__":
urls = [f"http://localhost:{port}" for port in range(8000, 8008)] urls = [f"http://localhost:{port}" for port in range(8000, 8008)]
img_prompts = { img_prompts = {
......
from loguru import logger from loguru import logger
from post_multi_servers import get_available_urls, process_tasks_async from post_multi_servers import get_available_urls, process_tasks_async
if __name__ == "__main__": if __name__ == "__main__":
urls = ["http://localhost:8000", "http://localhost:8001"] urls = ["http://localhost:8000", "http://localhost:8001"]
prompts = [ prompts = [
......
import argparse import argparse
import glob import glob
import os import os
from loguru import logger from loguru import logger
from post_multi_servers import get_available_urls, process_tasks_async from post_multi_servers import get_available_urls, process_tasks_async
......
import requests import requests
from loguru import logger from loguru import logger
response = requests.get("http://localhost:8000/v1/local/video/generate/stop_running_task") response = requests.get("http://localhost:8000/v1/local/video/generate/stop_running_task")
logger.info(response.json()) logger.info(response.json())
import os import argparse
import re
import gc import gc
import glob import glob
import json import json
import argparse import os
import re
import shutil import shutil
from collections import defaultdict
import torch import torch
from safetensors import safe_open, torch as st
from loguru import logger from loguru import logger
from tqdm import tqdm
from collections import defaultdict
from qtorch.quant import float_quantize from qtorch.quant import float_quantize
from safetensors import safe_open
from safetensors import torch as st
from tqdm import tqdm
def get_key_mapping_rules(direction, model_type): def get_key_mapping_rules(direction, model_type):
......
from pathlib import Path
import os
import argparse import argparse
import os
from pathlib import Path
import torch import torch
from loguru import logger from loguru import logger
......
#!/usr/bin/env python3 #!/usr/bin/env python3
# coding: utf-8 # coding: utf-8
import argparse
import os import os
import shutil
import sys import sys
import requests
import zipfile import zipfile
import shutil
import argparse
from pathlib import Path from pathlib import Path
import requests
def get_base_dir(): def get_base_dir():
"""Get project root directory""" """Get project root directory"""
......
...@@ -4,11 +4,11 @@ ...@@ -4,11 +4,11 @@
### ###
### ViGen-DiT Project Url: https://github.com/yl-1993/ViGen-DiT ### ViGen-DiT Project Url: https://github.com/yl-1993/ViGen-DiT
### ###
import torch
import sys
import os import os
from safetensors.torch import save_file import sys
from safetensors.torch import load_file
import torch
from safetensors.torch import load_file, save_file
if len(sys.argv) != 3: if len(sys.argv) != 3:
print("用法: python convert_lora.py <输入文件> <输出文件.safetensors>") print("用法: python convert_lora.py <输入文件> <输出文件.safetensors>")
......
...@@ -6,11 +6,13 @@ Extract LoRA weights from the difference between two models ...@@ -6,11 +6,13 @@ Extract LoRA weights from the difference between two models
""" """
import argparse import argparse
import torch
from safetensors import safe_open, torch as st
import os import os
from pathlib import Path from pathlib import Path
from typing import Dict, Any, Optional from typing import Any, Dict, Optional
import torch
from safetensors import safe_open
from safetensors import torch as st
from tqdm import tqdm from tqdm import tqdm
......
...@@ -6,11 +6,13 @@ Merge a source model with LoRA weights to create a new model ...@@ -6,11 +6,13 @@ Merge a source model with LoRA weights to create a new model
""" """
import argparse import argparse
import torch
from safetensors import safe_open, torch as st
import os import os
from pathlib import Path from pathlib import Path
from typing import Dict, Any, Optional from typing import Any, Dict, Optional
import torch
from safetensors import safe_open
from safetensors import torch as st
from tqdm import tqdm from tqdm import tqdm
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment