repo_full_name stringlengths 6 93 | repo_url stringlengths 25 112 | repo_api_url stringclasses 28
values | owner stringclasses 28
values | repo_name stringclasses 28
values | description stringclasses 28
values | stars int64 617 98.8k | forks int64 31 355 ⌀ | watchers int64 990 999 ⌀ | license stringclasses 2
values | default_branch stringclasses 2
values | repo_created_at timestamp[s]date 2012-07-24 23:12:50 2025-06-16 08:07:28 ⌀ | repo_updated_at timestamp[s]date 2026-02-23 15:23:15 2026-05-03 18:52:12 ⌀ | repo_topics listlengths 0 13 ⌀ | repo_languages unknown | is_fork bool 1
class | open_issues int64 3 104 ⌀ | file_path stringlengths 3 208 | file_name stringclasses 509
values | file_extension stringclasses 1
value | file_size_bytes int64 101 84k ⌀ | file_url stringclasses 627
values | file_raw_url stringclasses 627
values | file_sha stringclasses 624
values | language stringclasses 8
values | parsed_at stringdate 2026-05-04 01:12:36 2026-05-04 19:41:55 | text stringlengths 100 102k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
NVlabs/Fast-dLLM | https://github.com/NVlabs/Fast-dLLM | null | null | null | null | 952 | null | null | apache-2.0 | null | null | null | null | null | null | null | fast_dvlm/sglang/benchmark/hicache/nextqa.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:39.000243 | import os
import sys
from typing import List
import av
from datasets import load_dataset
def find_video_files(video_dir) -> List[str]:
if os.path.isfile(video_dir):
return [video_dir]
video_files = []
for root, dirs, files in os.walk(video_dir):
for file in files:
if file.end... |
NVlabs/Fast-dLLM | https://github.com/NVlabs/Fast-dLLM | null | null | null | null | 952 | null | null | apache-2.0 | null | null | null | null | null | null | null | fast_dvlm/sglang/benchmark/hicache/bench_multiturn.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:39.915701 | import argparse
import asyncio
import json
import queue
import random
import threading
import time
from datetime import datetime
from typing import Optional
import aiohttp
import numpy as np
import requests
from tqdm.asyncio import tqdm
from sglang.bench_serving import (
RequestFuncOutput,
get_tokenizer,
... |
NVlabs/Fast-dLLM | https://github.com/NVlabs/Fast-dLLM | null | null | null | null | 952 | null | null | apache-2.0 | null | null | null | null | null | null | null | fast_dvlm/sglang/benchmark/json_jump_forward/build_dataset.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:40.803866 | import json
import transformers
import wikipedia
model_path = "meta-llama/Llama-2-7b-chat-hf"
t = transformers.AutoTokenizer.from_pretrained(model_path)
city_names = [
"los angles",
"london",
"tokyo",
"beijing",
"singapore",
"paris",
"dubai",
"sydney",
"moscow",
"rome",
"to... |
NVlabs/Fast-dLLM | https://github.com/NVlabs/Fast-dLLM | null | null | null | null | 952 | null | null | apache-2.0 | null | null | null | null | null | null | null | fast_dvlm/sglang/benchmark/json_schema/bench_sglang.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:40.807194 | import argparse
import json
import time
from typing import List, Tuple
import jsonschema
from datasets import load_dataset
import sglang as sgl
from sglang.global_config import global_config
from sglang.srt.utils.hf_transformers_utils import get_tokenizer
from sglang.test.test_utils import (
add_common_sglang_arg... |
NVlabs/Fast-dLLM | https://github.com/NVlabs/Fast-dLLM | null | null | null | null | 952 | null | null | apache-2.0 | null | null | null | null | null | null | null | fast_dvlm/sglang/benchmark/json_jump_forward/bench_sglang.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:40.808697 | import argparse
import json
import time
import sglang as sgl
from sglang.test.test_utils import (
add_common_sglang_args_and_parse,
select_sglang_backend,
)
from sglang.utils import dump_state_text, read_jsonl
# there are some FSM bugs with json regex converted from pydantic model
# here use a string regex in... |
NVlabs/Fast-dLLM | https://github.com/NVlabs/Fast-dLLM | null | null | null | null | 952 | null | null | apache-2.0 | null | null | null | null | null | null | null | fast_dvlm/sglang/benchmark/json_jump_forward/bench_other.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:40.810058 | import argparse
import json
import time
from concurrent.futures import ThreadPoolExecutor
from functools import partial
import guidance
from tqdm import tqdm
from sglang.test.test_utils import add_common_other_args_and_parse, get_call_generate
from sglang.utils import dump_state_text, read_jsonl
# there are some FSM... |
NVlabs/Fast-dLLM | https://github.com/NVlabs/Fast-dLLM | null | null | null | null | 952 | null | null | apache-2.0 | null | null | null | null | null | null | null | fast_dvlm/sglang/benchmark/kernels/all_reduce/benchmark_mscclpp.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:40.845453 | """For Now, MSCCL is only supported on TP16 and TP8 case
export WORLD_SIZE=1
export RANK=0
export MASTER_ADDR=127.0.0.1
export MASTER_PORT=12345
torchrun --nproc_per_node gpu \
--nnodes $WORLD_SIZE \
--node_rank $RANK \
--master_addr $MASTER_ADDR \
--master_port $MASTER_PORT benchmark/kernels/all_reduce/benchmark_msc... |
NVlabs/Fast-dLLM | https://github.com/NVlabs/Fast-dLLM | null | null | null | null | 952 | null | null | apache-2.0 | null | null | null | null | null | null | null | fast_dvlm/sglang/benchmark/kernels/all_reduce/benchmark_aiter.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:40.845992 | """
Benchmark SGLang vs Aiter custom all-reduce across message sizes.
Usage:
torchrun --nproc_per_node=2 benchmark_aiter.py
torchrun --nproc_per_node=4 benchmark_aiter.py
torchrun --nproc_per_node=8 benchmark_aiter.py
"""
import argparse
import os
import sys
import time
from typing import List, Optional, T... |
NVlabs/Fast-dLLM | https://github.com/NVlabs/Fast-dLLM | null | null | null | null | 952 | null | null | apache-2.0 | null | null | null | null | null | null | null | fast_dvlm/sglang/benchmark/hicache/bench_serving.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:40.847881 | # Adapted from https://github.com/vllm-project/vllm/blob/6366efc67b0aedd2c1721c14385370e50b297fb3/benchmarks/backend_request_func.py
# Adapted from https://github.com/vllm-project/vllm/blob/6366efc67b0aedd2c1721c14385370e50b297fb3/benchmarks/benchmark_serving.py
"""
Benchmark online serving with dynamic requests.
Usa... |
NVlabs/Fast-dLLM | https://github.com/NVlabs/Fast-dLLM | null | null | null | null | 952 | null | null | apache-2.0 | null | null | null | null | null | null | null | fast_dvlm/sglang/benchmark/kernels/all_reduce/benchmark_torch_symm_mem.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:40.912817 | """For Now, TORCH_SYMM_MEM is only supported on following limited tp case
SM90: {
2: 64 * MiB, # 64 MB
4: 64 * MiB, # 64 MB
6: 128 * MiB, # 128 MB
8: 128 * MiB, # 128 MB
},
SM100: {
2: 64 * MiB, # 64 MB
4: 64 * MiB, # 64 MB
6: 128 * MiB, # 128 MB
8: 128 * MiB, # 128 MB
}
export... |
NVlabs/Fast-dLLM | https://github.com/NVlabs/Fast-dLLM | null | null | null | null | 952 | null | null | apache-2.0 | null | null | null | null | null | null | null | fast_dvlm/sglang/benchmark/kernels/deepseek/benchmark_deepgemm_fp8_gemm.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:41.636774 | from typing import Tuple
import deep_gemm
import tilelang
import tilelang.language as T
import torch
import triton
from deep_gemm import ceil_div
from deep_gemm.utils.layout import get_mn_major_tma_aligned_tensor
from vllm.model_executor.layers.quantization.utils.fp8_utils import (
w8a8_block_fp8_matmul as vllm_w8... |
NVlabs/Fast-dLLM | https://github.com/NVlabs/Fast-dLLM | null | null | null | null | 952 | null | null | apache-2.0 | null | null | null | null | null | null | null | fast_dvlm/sglang/benchmark/kernels/deepseek/benchmark_deepgemm_fp8_gemm_blackwell.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:41.644514 | import argparse
from typing import Tuple
import torch
import triton
from deep_gemm import ceil_div
from flashinfer.gemm import gemm_fp8_nt_groupwise
from sglang.srt.layers.quantization.fp8_kernel import (
sglang_per_token_group_quant_fp8,
w8a8_block_fp8_matmul_deepgemm,
)
from sglang.srt.layers.quantization.f... |
NVlabs/Fast-dLLM | https://github.com/NVlabs/Fast-dLLM | null | null | null | null | 952 | null | null | apache-2.0 | null | null | null | null | null | null | null | fast_dvlm/sglang/benchmark/kernels/deepep/tuning_deepep.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:41.680688 | # MODIFIED FROM https://github.com/deepseek-ai/DeepEP/blob/main/tests/test_internode.py
"""
Example usage:
python tuning_deepep.py --nnodes 4 --node-rank $MY_NODE_RANK --master-addr 1.2.3.4
Then check `deepep_tuned.json`
"""
import argparse
import json
import time
from copy import deepcopy
from pathlib import Path
#... |
NVlabs/Fast-dLLM | https://github.com/NVlabs/Fast-dLLM | null | null | null | null | 952 | null | null | apache-2.0 | null | null | null | null | null | null | null | fast_dvlm/sglang/benchmark/kernels/deepep/deepep_utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:41.825323 | # ADAPTED FROM https://github.com/deepseek-ai/DeepEP/blob/main/tests/utils.py
import os
import sys
from typing import Optional
import numpy as np
import torch
import torch.distributed as dist
def init_dist(local_rank: int, num_local_ranks: int, args):
ip = args.master_addr
port = args.master_port
num_no... |
NVlabs/Fast-dLLM | https://github.com/NVlabs/Fast-dLLM | null | null | null | null | 952 | null | null | apache-2.0 | null | null | null | null | null | null | null | fast_dvlm/sglang/benchmark/kernels/decoding_attention_triton/triton_flashinfer_cudnn.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:41.926389 | import itertools
import math
import cudnn
import torch
import torch.utils.benchmark as benchmark
from flashinfer import BatchDecodeWithPagedKVCacheWrapper
from sglang.srt.layers.attention.triton_ops.decode_attention import decode_attention_fwd
from sglang.srt.utils import should_use_tensor_core
def benchmark_forwar... |
NVlabs/Fast-dLLM | https://github.com/NVlabs/Fast-dLLM | null | null | null | null | 952 | null | null | apache-2.0 | null | null | null | null | null | null | null | fast_dvlm/sglang/benchmark/kernels/elementwise/benchmark_concat_mla.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:42.195740 | import torch
import triton
import triton.language as tl
from sgl_kernel import concat_mla_k as concat_mla_k_cuda
DEVICE = triton.runtime.driver.active.get_active_torch_device()
num_local_heads = 128
qk_nope_head_dim = 128
qk_rope_head_dim = 64
def create_data(num_tokens):
k_nope_container = torch.randn(
... |
NVlabs/Fast-dLLM | https://github.com/NVlabs/Fast-dLLM | null | null | null | null | 952 | null | null | apache-2.0 | null | null | null | null | null | null | null | fast_dvlm/sglang/benchmark/kernels/fused_moe_triton/benchmark_sglang_fused_moe_triton.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:42.196214 | # python3 benchmark/kernels/fused_moe_triton/sglang_fused_moe_triton.py --model /DeepSeek-V3/ --tp-size 8
import argparse
import torch
import triton
from common_utils import get_model_config
from sglang.srt.distributed.parallel_state import (
destroy_distributed_environment,
destroy_model_parallel,
init_d... |
NVlabs/Fast-dLLM | https://github.com/NVlabs/Fast-dLLM | null | null | null | null | 952 | null | null | apache-2.0 | null | null | null | null | null | null | null | fast_dvlm/sglang/benchmark/kernels/fused_moe_triton/benchmark_torch_compile_fused_moe.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:42.277085 | # python3 benchmark/kernels/fused_moe_triton/benchmark_torch_compile_fused_moe.py --model /DeepSeek-V3/ --tp-size 8 --use-fp8-w8a8
import argparse
import torch
import triton
from torch.nn import functional as F
from transformers import AutoConfig
from sglang.srt.layers.moe.fused_moe_triton.fused_moe import (
fuse... |
NVlabs/Fast-dLLM | https://github.com/NVlabs/Fast-dLLM | null | null | null | null | 952 | null | null | apache-2.0 | null | null | null | null | null | null | null | fast_dvlm/sglang/benchmark/kernels/fused_moe_triton/benchmark_vllm_vs_sglang_fused_moe_triton.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:42.296290 | # python3 benchmark/kernels/fused_moe_triton/benchmark_vllm_vs_sglang_fused_moe_triton.py --model /DeepSeek-V3/ --tp-size 8 --use-fp8-w8a8
import argparse
import torch
import triton
from vllm.model_executor.layers.fused_moe.fused_moe import fused_moe as fused_moe_vllm
from sglang.srt.distributed.parallel_state import... |
NVlabs/Fast-dLLM | https://github.com/NVlabs/Fast-dLLM | null | null | null | null | 952 | null | null | apache-2.0 | null | null | null | null | null | null | null | fast_dvlm/sglang/benchmark/kernels/deepseek/benchmark_deepgemm_fp8_group_gemm.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:42.456640 | from typing import Tuple
import deep_gemm
import torch
import triton
import triton.language as tl
from deep_gemm import calc_diff
from deep_gemm.utils.layout import get_mn_major_tma_aligned_tensor
# Import shared functionality from the regular GEMM benchmark
from sglang.benchmark.kernels.deepseek.benchmark_deepgemm_f... |
NVlabs/Fast-dLLM | https://github.com/NVlabs/Fast-dLLM | null | null | null | null | 952 | null | null | apache-2.0 | null | null | null | null | null | null | null | fast_dvlm/sglang/benchmark/kernels/flashinfer_allreduce_fusion/benchmark_fused_collective.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:42.792362 | # Modified from https://github.com/vllm-project/vllm/blob/237e1fb887c7f5a579420fa0295097f24b006594/benchmarks/kernels/benchmark_fused_collective.py
"""
Benchmark for FlashInfer fused collective operations vs standard operations.
This benchmark compares:
1. FlashInfer's trtllm_allreduce_fusion (fused allreduce + rmsno... |
NVlabs/Fast-dLLM | https://github.com/NVlabs/Fast-dLLM | null | null | null | null | 952 | null | null | apache-2.0 | null | null | null | null | null | null | null | fast_dvlm/sglang/benchmark/json_decode_regex/build_dataset.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:49.346432 | import json
import transformers
import wikipedia
model_path = "meta-llama/Llama-2-7b-chat-hf"
t = transformers.AutoTokenizer.from_pretrained(model_path)
city_names = [
"los angles",
"london",
"tokyo",
"beijing",
"singapore",
"paris",
"dubai",
"sydney",
"moscow",
"rome",
"to... |
NVlabs/Fast-dLLM | https://github.com/NVlabs/Fast-dLLM | null | null | null | null | 952 | null | null | apache-2.0 | null | null | null | null | null | null | null | fast_dvlm/sglang/benchmark/json_decode_regex/bench_sglang.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:49.755409 | import argparse
import json
import time
import sglang as sgl
from sglang.lang.ir import REGEX_FLOAT, REGEX_INT, REGEX_STR
from sglang.test.test_utils import (
add_common_sglang_args_and_parse,
select_sglang_backend,
)
from sglang.utils import dump_state_text, read_jsonl
REGEX_LIST = r"\[(" + REGEX_STR + ", )*... |
SalesforceAIResearch/promptomatix | https://github.com/SalesforceAIResearch/promptomatix | null | null | null | null | 952 | null | null | apache-2.0 | null | null | null | null | null | null | null | setup.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:52.960130 | #!/usr/bin/env python3
"""
Complete setup script for Promptomatix with all dependencies.
Run: python setup.py install
"""
import os
import subprocess
import sys
from setuptools import setup, find_packages
def download_nltk_data():
"""Download required NLTK data during installation."""
try:
import nltk... |
SalesforceAIResearch/promptomatix | https://github.com/SalesforceAIResearch/promptomatix | null | null | null | null | 952 | null | null | apache-2.0 | null | null | null | null | null | null | null | examples/scripts/basic_example.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:53.065018 | #!/usr/bin/env python3
"""
Basic Example Script for Promptomatix
This script demonstrates the three core workflows:
1. Prompt Optimization
2. Feedback Generation
3. Optimization with Feedback
Usage:
python basic_example.py
"""
import os
import sys
from dotenv import load_dotenv
# Add the src directory to Pyth... |
SalesforceAIResearch/promptomatix | https://github.com/SalesforceAIResearch/promptomatix | null | null | null | null | 952 | null | null | apache-2.0 | null | null | null | null | null | null | null | src/promptomatix/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:53.068146 | """
Promptomatix: A Powerful Framework for LLM Prompt Optimization.
A comprehensive tool for automating and optimizing large language model (LLM) prompts
using DSPy and advanced optimization techniques.
"""
__version__ = "0.1.0"
__author__ = "Rithesh Murthy"
# Import main components for easy access
from .main import... |
SalesforceAIResearch/promptomatix | https://github.com/SalesforceAIResearch/promptomatix | null | null | null | null | 952 | null | null | apache-2.0 | null | null | null | null | null | null | null | src/promptomatix/cli/parser.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:53.068923 | """
Command-line interface parser for the prompt optimization tool.
"""
from argparse import ArgumentParser
from typing import Dict
def parse_args() -> Dict:
"""
Parse and validate command line arguments.
Returns:
Dict: Configuration dictionary with all parsed arguments
"""
parser = A... |
SalesforceAIResearch/promptomatix | https://github.com/SalesforceAIResearch/promptomatix | null | null | null | null | 952 | null | null | apache-2.0 | null | null | null | null | null | null | null | examples/scripts/batch_processing.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:53.172431 | #!/usr/bin/env python3
"""
Batch Processing Script for Promptomatix
This script demonstrates how to process multiple prompts efficiently:
- Sequential and parallel processing
- Cost tracking and optimization
- Error handling and retry logic
- Performance monitoring
Usage:
python batch_processing.py
"""
import os... |
SalesforceAIResearch/promptomatix | https://github.com/SalesforceAIResearch/promptomatix | null | null | null | null | 952 | null | null | apache-2.0 | null | null | null | null | null | null | null | examples/scripts/custom_metrics.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:53.278203 | #!/usr/bin/env python3
"""
Custom Metrics Script for Promptomatix
This script demonstrates how to implement and use custom evaluation metrics:
- Custom quality metrics
- Cost efficiency metrics
- Performance tracking
- Metric comparison and analysis
Usage:
python custom_metrics.py
"""
import os
import sys
import... |
SalesforceAIResearch/promptomatix | https://github.com/SalesforceAIResearch/promptomatix | null | null | null | null | 952 | null | null | apache-2.0 | null | null | null | null | null | null | null | src/promptomatix/core/session.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:54.035626 | """
Module for managing optimization sessions and their state.
"""
from datetime import datetime
from typing import List, Dict, Optional
from .feedback import Feedback
from ..utils.logging import SessionLogger
from ..core.config import Config, ModelProvider
from ..utils.paths import SESSIONS_DIR
import json
import os
... |
SalesforceAIResearch/promptomatix | https://github.com/SalesforceAIResearch/promptomatix | null | null | null | null | 952 | null | null | apache-2.0 | null | null | null | null | null | null | null | src/promptomatix/core/feedback.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:54.036171 | """
Module for handling feedback and annotations in the prompt optimization process.
"""
from datetime import datetime
from typing import List, Dict, Optional
import json
class Feedback:
"""
Represents a feedback or annotation on a prompt.
Attributes:
id (str): Unique identifier for the feedb... |
SalesforceAIResearch/promptomatix | https://github.com/SalesforceAIResearch/promptomatix | null | null | null | null | 952 | null | null | apache-2.0 | null | null | null | null | null | null | null | src/promptomatix/core/optimizer.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:54.038170 | """
Core module for prompt optimization functionality.
"""
import dspy
import ast
import json
from typing import Dict, List, Type, Optional, Union, Tuple
from datetime import datetime
from dspy.evaluate import Evaluate
import nltk
import os
import logging
from pathlib import Path
import requests
from ..utils.parsing ... |
SalesforceAIResearch/promptomatix | https://github.com/SalesforceAIResearch/promptomatix | null | null | null | null | 952 | null | null | apache-2.0 | null | null | null | null | null | null | null | src/promptomatix/core/config.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:54.141240 | import os
import ast
import json
import logging
from datetime import datetime
from enum import Enum
from pathlib import Path
from typing import Optional, List, Any, Dict, Type
import dspy
from datasets import load_dataset, Dataset
from ..utils.paths import CONFIG_LOGS_DIR
from .prompts import (
generate_dspy_modu... |
SalesforceAIResearch/promptomatix | https://github.com/SalesforceAIResearch/promptomatix | null | null | null | null | 952 | null | null | apache-2.0 | null | null | null | null | null | null | null | src/promptomatix/utils/parsing.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:54.589213 | """
Utility functions for parsing and cleaning text data.
"""
import json
import ast
from typing import Union, Dict, List
def parse_dict_strings(text: str) -> str:
"""
Parse and clean dictionary strings from various formats.
Args:
text (str): Input text containing dictionary-like structure
... |
SalesforceAIResearch/promptomatix | https://github.com/SalesforceAIResearch/promptomatix | null | null | null | null | 952 | null | null | apache-2.0 | null | null | null | null | null | null | null | src/promptomatix/utils/logging.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:54.593133 | """
Module for handling logging functionality.
"""
import logging
import os
from datetime import datetime
from typing import Dict, Any
import json
from pathlib import Path
from .paths import SESSION_LOGS_DIR
class SessionLogger:
"""
Handles logging for individual optimization sessions.
Attributes:
... |
SalesforceAIResearch/promptomatix | https://github.com/SalesforceAIResearch/promptomatix | null | null | null | null | 952 | null | null | apache-2.0 | null | null | null | null | null | null | null | src/promptomatix/utils/paths.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:54.643792 | """
Module for managing application paths and directories.
"""
import os
from pathlib import Path
# Get the project root directory (where the repository is cloned)
PROJECT_ROOT = Path(__file__).parent.parent.parent.parent
# Define base directories relative to project root
LOGS_DIR = PROJECT_ROOT / 'logs'
SESSIONS_DI... |
SalesforceAIResearch/promptomatix | https://github.com/SalesforceAIResearch/promptomatix | null | null | null | null | 952 | null | null | apache-2.0 | null | null | null | null | null | null | null | src/promptomatix/logger.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:54.655172 | import logging
from datetime import datetime
from typing import Dict, Any
import json
class SessionLogger:
def __init__(self, session_id: str):
self.session_id = session_id
self.log_entries = []
self.start_time = datetime.now()
def add_entry(self, event_type: str, details: Dict[str, An... |
SalesforceAIResearch/promptomatix | https://github.com/SalesforceAIResearch/promptomatix | null | null | null | null | 952 | null | null | apache-2.0 | null | null | null | null | null | null | null | src/promptomatix/lm_manager.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:54.760036 | from typing import Optional
import dspy
from dspy.backends import OpenAI, Anthropic, Cohere
class LMManager:
"""Manages Language Model initialization and configuration for different providers"""
SUPPORTED_PROVIDERS = {
'openai': OpenAI,
'anthropic': Anthropic,
'cohere': Cohere,
... |
SalesforceAIResearch/promptomatix | https://github.com/SalesforceAIResearch/promptomatix | null | null | null | null | 952 | null | null | apache-2.0 | null | null | null | null | null | null | null | src/promptomatix/main.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:54.865712 | """
Main entry point for the promptomatix prompt optimization tool.
"""
import os
import sys
import json
import dspy
import nltk
import traceback
from datetime import datetime
from typing import Dict, Optional, List
from pathlib import Path
import time
import ast
from openai import OpenAI, APITimeoutError, InternalSer... |
SalesforceAIResearch/promptomatix | https://github.com/SalesforceAIResearch/promptomatix | null | null | null | null | 952 | null | null | apache-2.0 | null | null | null | null | null | null | null | src/promptomatix/metrics/metrics.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:59.046226 | import warnings
import os
import sys
import contextlib
from nltk.translate.bleu_score import sentence_bleu
from rouge import Rouge
from typing import Callable, Dict, Any, Union, List
import numpy as np
from collections import Counter
import re
import math
from langdetect import detect # You'll need to: pip install lan... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | base/models/unet_blocks.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:01.319400 | # Adapted from https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/unet_2d_blocks.py
import os
import sys
sys.path.append(os.path.split(sys.path[0])[0])
import torch
from torch import nn
try:
from .attention import Transformer3DModel
from .resnet import Downsample3D, ResnetBlock3D, Upsampl... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | base/models/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:01.513048 | import os
import sys
sys.path.append(os.path.split(sys.path[0])[0])
from .unet import UNet3DConditionModel
from torch.optim.lr_scheduler import LambdaLR
def customized_lr_scheduler(optimizer, warmup_steps=5000): # 5000 from u-vit
from torch.optim.lr_scheduler import LambdaLR
def fn(step):
if... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | base/models/temporal_attention.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:01.516163 | import torch
from torch import nn
from typing import Optional
from rotary_embedding_torch import RotaryEmbedding
from dataclasses import dataclass
from diffusers.utils import BaseOutput
from diffusers.utils.import_utils import is_xformers_available
import torch.nn.functional as F
from einops import rearrange, repeat
im... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | base/models/transformer_3d.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:01.517906 |
# 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 t... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | base/models/attention.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:01.519634 | # Adapted from https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention.py
import os
import sys
sys.path.append(os.path.split(sys.path[0])[0])
from dataclasses import dataclass
from typing import Optional
import math
import torch
import torch.nn.functional as F
from torch import nn
from diff... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | base/models/clip.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:01.521379 | import numpy
import torch.nn as nn
from transformers import CLIPTokenizer, CLIPTextModel
import transformers
transformers.logging.set_verbosity_error()
"""
Will encounter following warning:
- This IS expected if you are initializing CLIPTextModel from the checkpoint of a model trained on another task
or wit... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | base/models/resnet.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:01.523235 | # Adapted from https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/resnet.py
import os
import sys
sys.path.append(os.path.split(sys.path[0])[0])
import torch
import torch.nn as nn
import torch.nn.functional as F
from einops import rearrange
class InflatedConv3d(nn.Conv2d):
def forward(self, ... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | base/download.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:01.524189 | # All rights reserved.
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
import torch
import os
def find_model(model_name):
"""
Finds a pre-trained model, downloading it if necessary. Alternatively, loads a model from a local path.
""... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | base/models/unet.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:01.525812 | # Adapted from https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/unet_2d_condition.py
from dataclasses import dataclass
from typing import List, Optional, Tuple, Union
import os
import sys
sys.path.append(os.path.split(sys.path[0])[0])
import math
import json
import torch
import einops
import t... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | base/models/utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:01.526297 | # adopted from
# https://github.com/openai/improved-diffusion/blob/main/improved_diffusion/gaussian_diffusion.py
# and
# https://github.com/lucidrains/denoising-diffusion-pytorch/blob/7706bdfc6f527f58d33f84b7b522e61e6e3164b3/denoising_diffusion_pytorch/denoising_diffusion_pytorch.py
# and
# https://github.com/open... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | base/pipelines/pipeline_videogen.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:02.157040 |
# 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 t... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | interpolation/download.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:02.536327 | import os
import torch
def find_model(model_name):
checkpoint = torch.load(model_name, map_location=lambda storage, loc: storage)
if "ema" in checkpoint: # supports checkpoints from train.py
checkpoint = checkpoint["ema"]
return checkpoint
|
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | interpolation/diffusion/timestep_sampler.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:02.539231 | # Modified from OpenAI's diffusion repos
# GLIDE: https://github.com/openai/glide-text2im/blob/main/glide_text2im/gaussian_diffusion.py
# ADM: https://github.com/openai/guided-diffusion/blob/main/guided_diffusion
# IDDPM: https://github.com/openai/improved-diffusion/blob/main/improved_diffusion/gaussian_d... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | interpolation/datasets/video_transforms.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:02.540635 | import torch
import random
import numbers
from torchvision.transforms import RandomCrop, RandomResizedCrop
def _is_tensor_video_clip(clip):
if not torch.is_tensor(clip):
raise TypeError("clip should be Tensor. Got %s" % type(clip))
if not clip.ndimension() == 4:
raise ValueError("clip should b... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | interpolation/diffusion/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:02.541648 | # Modified from OpenAI's diffusion repos
# GLIDE: https://github.com/openai/glide-text2im/blob/main/glide_text2im/gaussian_diffusion.py
# ADM: https://github.com/openai/guided-diffusion/blob/main/guided_diffusion
# IDDPM: https://github.com/openai/improved-diffusion/blob/main/improved_diffusion/gaussia... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | interpolation/diffusion/respace.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:02.545066 | # Modified from OpenAI's diffusion repos
# GLIDE: https://github.com/openai/glide-text2im/blob/main/glide_text2im/gaussian_diffusion.py
# ADM: https://github.com/openai/guided-diffusion/blob/main/guided_diffusion
# IDDPM: https://github.com/openai/improved-diffusion/blob/main/improved_diffusion/gaussian_d... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | base/pipelines/sample.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:02.545618 | import os
import torch
import argparse
import torchvision
from pipeline_videogen import VideoGenPipeline
from download import find_model
from diffusers.schedulers import DDIMScheduler, DDPMScheduler, PNDMScheduler, EulerDiscreteScheduler
from diffusers.models import AutoencoderKL
from transformers import CLIPTokenize... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | interpolation/diffusion/diffusion_utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:02.547736 | # Modified from OpenAI's diffusion repos
# GLIDE: https://github.com/openai/glide-text2im/blob/main/glide_text2im/gaussian_diffusion.py
# ADM: https://github.com/openai/guided-diffusion/blob/main/guided_diffusion
# IDDPM: https://github.com/openai/improved-diffusion/blob/main/improved_diffusion/gaussian_d... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | interpolation/diffusion/gaussian_diffusion.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:02.549155 | # Modified from OpenAI's diffusion repos
# GLIDE: https://github.com/openai/glide-text2im/blob/main/glide_text2im/gaussian_diffusion.py
# ADM: https://github.com/openai/guided-diffusion/blob/main/guided_diffusion
# IDDPM: https://github.com/openai/improved-diffusion/blob/main/improved_diffusion/gaussia... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | interpolation/models/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:02.946570 | import os
import sys
sys.path.append(os.path.split(sys.path[0])[0])
from .unet import UNet3DConditionModel
from torch.optim.lr_scheduler import LambdaLR
def customized_lr_scheduler(optimizer, warmup_steps=5000): # 5000 from u-vit
from torch.optim.lr_scheduler import LambdaLR
def fn(step):
if... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | interpolation/models/utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:03.296302 | # adopted from
# https://github.com/openai/improved-diffusion/blob/main/improved_diffusion/gaussian_diffusion.py
# and
# https://github.com/lucidrains/denoising-diffusion-pytorch/blob/7706bdfc6f527f58d33f84b7b522e61e6e3164b3/denoising_diffusion_pytorch/denoising_diffusion_pytorch.py
# and
# https://github.com/openai/gu... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | interpolation/utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:03.313999 | import os
import math
import torch
import logging
import subprocess
import numpy as np
import torch.distributed as dist
# from torch._six import inf
from torch import inf
from PIL import Image
from typing import Union, Iterable
from collections import OrderedDict
_tensor_or_tensors = Union[torch.Tensor, Iterable[t... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | interpolation/models/attention.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:03.316107 | # Adapted from https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention.py
import os
import sys
sys.path.append(os.path.split(sys.path[0])[0])
from dataclasses import dataclass
from typing import Optional
import math
import torch
import torch.nn.functional as F
from torch import nn
from diff... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | interpolation/models/clip.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:03.323246 | import numpy
import torch.nn as nn
from transformers import CLIPTokenizer, CLIPTextModel
import transformers
transformers.logging.set_verbosity_error()
"""
Will encounter following warning:
- This IS expected if you are initializing CLIPTextModel from the checkpoint of a model trained on another task
or wit... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | interpolation/models/unet.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:03.324267 | # Adapted from https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/unet_2d_condition.py
from dataclasses import dataclass
from typing import List, Optional, Tuple, Union
import os
import sys
sys.path.append(os.path.split(sys.path[0])[0])
import json
import torch
import torch.nn as nn
import torc... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | interpolation/sample.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:03.331410 | """
we introduce a temporal interpolation network to enhance the smoothness of generated videos and synthesize richer temporal details.
This network takes a 16-frame base video as input and produces an upsampled output consisting of 61 frames.
"""
import os
import sys
import math
try:
import utils
from diffusion im... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | interpolation/models/resnet.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:03.332946 | # Adapted from https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/resnet.py
import os
import sys
sys.path.append(os.path.split(sys.path[0])[0])
import torch
import torch.nn as nn
import torch.nn.functional as F
from einops import rearrange
class InflatedConv3d(nn.Conv2d):
def forward(self, ... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | predict.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:03.342327 | # Prediction interface for Cog ⚙️
# https://github.com/replicate/cog/blob/main/docs/python.md
import os
import sys
import json
import numpy as np
import torch
import shutil
from omegaconf import OmegaConf
import imageio
from einops import rearrange
import torchvision
from torchvision import transforms
from decord impo... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | interpolation/models/unet_blocks.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:03.368538 | # Adapted from https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/unet_2d_blocks.py
import os
import sys
sys.path.append(os.path.split(sys.path[0])[0])
import torch
from torch import nn
try:
from .attention import Transformer3DModel
from .resnet import Downsample3D, ResnetBlock3D, Upsampl... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | vsr/diffusion/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:03.579117 | # Modified from OpenAI's diffusion repos
# GLIDE: https://github.com/openai/glide-text2im/blob/main/glide_text2im/gaussian_diffusion.py
# ADM: https://github.com/openai/guided-diffusion/blob/main/guided_diffusion
# IDDPM: https://github.com/openai/improved-diffusion/blob/main/improved_diffusion/gaussia... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | vsr/diffusion/diffusion_utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:04.292626 | # Modified from OpenAI's diffusion repos
# GLIDE: https://github.com/openai/glide-text2im/blob/main/glide_text2im/gaussian_diffusion.py
# ADM: https://github.com/openai/guided-diffusion/blob/main/guided_diffusion
# IDDPM: https://github.com/openai/improved-diffusion/blob/main/improved_diffusion/gaussian_d... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | vsr/models/autoencoder_kl.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:04.297354 | # Copyright 2023 The HuggingFace Team. All rights reserved.
#
# 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 ... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | vsr/diffusion/scheduling_ddim.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:04.300471 | # Copyright 2023 Stanford University Team and The HuggingFace Team. All rights reserved.
#
# 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
#
#... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | vsr/diffusion/gaussian_diffusion.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:04.302025 | # Modified from OpenAI's diffusion repos
# GLIDE: https://github.com/openai/glide-text2im/blob/main/glide_text2im/gaussian_diffusion.py
# ADM: https://github.com/openai/guided-diffusion/blob/main/guided_diffusion
# IDDPM: https://github.com/openai/improved-diffusion/blob/main/improved_diffusion/gaussia... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | vsr/diffusion/timestep_sampler.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:04.333381 | # Modified from OpenAI's diffusion repos
# GLIDE: https://github.com/openai/glide-text2im/blob/main/glide_text2im/gaussian_diffusion.py
# ADM: https://github.com/openai/guided-diffusion/blob/main/guided_diffusion
# IDDPM: https://github.com/openai/improved-diffusion/blob/main/improved_diffusion/gaussian_d... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | vsr/models/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:04.355206 | from .unet import UNet3DVSRModel
from torch.optim.lr_scheduler import LambdaLR
def customized_lr_scheduler(optimizer, warmup_steps=5000): # 5000 from u-vit
from torch.optim.lr_scheduler import LambdaLR
def fn(step):
if warmup_steps > 0:
return min(step / warmup_steps, 1)
els... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | vsr/models/attention.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:04.356256 | # Adapted from https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention.py
import os
import sys
sys.path.append(os.path.split(sys.path[0])[0])
from dataclasses import dataclass
from typing import Optional
import math
import torch
import torch.nn.functional as F
from torch import nn
from diff... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | vsr/diffusion/respace.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:04.455387 | # Modified from OpenAI's diffusion repos
# GLIDE: https://github.com/openai/glide-text2im/blob/main/glide_text2im/gaussian_diffusion.py
# ADM: https://github.com/openai/guided-diffusion/blob/main/guided_diffusion
# IDDPM: https://github.com/openai/improved-diffusion/blob/main/improved_diffusion/gaussian_d... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | vsr/models/pipeline_stable_diffusion_upscale_video_3d.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:04.882448 |
# 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 t... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | vsr/models/unet.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:04.883574 | # Adapted from https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/unet_2d_condition.py
from dataclasses import dataclass
from typing import List, Optional, Tuple, Union
import os
import sys
sys.path.append(os.path.split(sys.path[0])[0])
import json
import math
import torch
import torch.nn as nn
... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | vsr/models/temporal_module.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:04.885027 | from dataclasses import dataclass
from typing import List, Optional, Tuple, Union
import torch
import numpy as np
import torch.nn.functional as F
from torch import nn
import torchvision
# from torch_utils.ops import grid_sample_gradfix
from diffusers.configuration_utils import ConfigMixin, register_to_config
from dif... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | vsr/models/resnet.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:04.892930 | # Adapted from https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/resnet.py
import os
import sys
sys.path.append(os.path.split(sys.path[0])[0])
import torch
import torch.nn as nn
import torch.nn.functional as F
from einops import rearrange
def zero_module(module):
"""
Zero out the paramet... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | vsr/models/unet_blocks.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:04.909500 | # Adapted from https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/unet_2d_blocks.py
import os
import sys
sys.path.append(os.path.split(sys.path[0])[0])
import torch
from torch import nn
try:
from .attention import Transformer3DModel
from .resnet import Downsample3D, ResnetBlock3D, Upsampl... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | vsr/models/upscaling.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:04.929934 | import torch
import torch.nn as nn
import numpy as np
from functools import partial
from inspect import isfunction
def exists(x):
return x is not None
def default(val, d):
if exists(val):
return val
return d() if isfunction(d) else d
def extract_into_tensor(a, t, x_shape):
b, *_ = t.shape
... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | vsr/models/utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:04.972099 | # adopted from
# https://github.com/openai/improved-diffusion/blob/main/improved_diffusion/gaussian_diffusion.py
# and
# https://github.com/lucidrains/denoising-diffusion-pytorch/blob/7706bdfc6f527f58d33f84b7b522e61e6e3164b3/denoising_diffusion_pytorch/denoising_diffusion_pytorch.py
# and
# https://github.com/openai/gu... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | vsr/sample.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:04.990835 | import io
import os
import sys
import argparse
o_path = os.getcwd()
sys.path.append(o_path)
import torch
import time
import json
import numpy as np
import imageio
import torchvision
from einops import rearrange
from models.autoencoder_kl import AutoencoderKL
from models.unet import UNet3DVSRModel
from models.pipeline... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | vsr/models/clip.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:05.078397 | import numpy
import torch.nn as nn
from transformers import CLIPTokenizer, CLIPTextModel
from diffusers import StableDiffusionUpscalePipeline
"""
Will encounter following warning:
- This IS expected if you are initializing CLIPTextModel from the checkpoint of a model trained on another task
or with another arc... |
Vchitect/LaVie | https://github.com/Vchitect/LaVie | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | vsr/models/diffusers_attention.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:10.003103 | # Copyright 2022 The HuggingFace Team. All rights reserved.
#
# 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 applicabl... |
baidu/CUP | https://github.com/baidu/CUP | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | cup_test/cup_mail_test.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:13.301520 | #!/usr/bin/env python
# -*- coding: utf-8 -*
# Copyright: See LICENSE for details.
# Authors: Guannan Ma (@mythmgn),
"""
:description:
"""
# vi:set tw=0 ts=4 sw=4 nowrap fdm=indent
|
baidu/CUP | https://github.com/baidu/CUP | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | cup_test/cup_net_init_test.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:13.302444 | #!/bin/env python
# -*- coding: utf-8 -*
"""
Author: (Guannan Ma)
"""
import os
import sys
import pdb
import unittest as sysunit
import socket
_NOW_PATH = os.path.dirname(os.path.abspath(__file__)) + '/'
sys.path.insert(0, _NOW_PATH + '../')
from cup import net
from cup.net import route
from cup import platforms... |
baidu/CUP | https://github.com/baidu/CUP | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | build_doc.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:13.303918 | #!/usr/bin/env python
# -*- coding: utf-8 -*
# Copyright: [CUP] - See LICENSE for details.
# Authors: Guannan Ma (@mythmgn),
"""
:description:
decorators related module
"""
import os
import sys
import argparse
_NOW_PATH = os.path.dirname(os.path.abspath(__file__)) + '/'
_TOP_PATH = os.path.abspath(_NOW_PATH + '/..... |
baidu/CUP | https://github.com/baidu/CUP | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | cup_test/cup_import_test.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:13.304851 | #!/usr/bin/env python
# -*- coding: utf-8 -*
# Copyright: [CUP] - See LICENSE for details.
# Authors: Guannan Ma (@mythmgn),
"""
:description:
decorators related module
"""
import os
import sys
_NOW_PATH = os.path.dirname(os.path.abspath(__file__)) + '/'
sys.path.insert(0, _NOW_PATH + '../')
# from cup.thirdp im... |
baidu/CUP | https://github.com/baidu/CUP | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | cup_test/cup_net_async_test.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:13.306603 | #!/bin/env python
# -*- coding: utf-8 -*
"""
@author Guannan Ma
@brief
@note
"""
import os
import sys
_NOW_PATH = os.path.dirname(os.path.abspath(__file__)) + '/'
sys.path.insert(0, _NOW_PATH + '../')
import cup
from cup import unittest
#from cup.unittest import CCaseExecutor
from cup.net import asyn
# f... |
baidu/CUP | https://github.com/baidu/CUP | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | cup_test/cup_exfile_test.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:13.307107 | #!/usr/bin/env python
# -*- coding: utf-8 -*
"""
:authors:
Guannan Ma maguannan @mythmgn
:description:
"""
import os
import sys
_TOP = os.path.dirname(os.path.abspath(__file__)) + '/../'
_TESTDIR = os.path.dirname(os.path.abspath(__file__)) + '/'
sys.path.insert(0, _TOP)
from cup import err
from cup import exfil... |
baidu/CUP | https://github.com/baidu/CUP | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | cup_test/cup_cache_test.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:13.308836 | #!/usr/bin/env python
# -*- coding: utf-8 -*
# Copyright: [CUP] - See LICENSE for details.
# Authors: Guannan Ma (@mythmgn),
"""
:description:
unittest for cup.cache
"""
import time
import unittest
import threading
from cup import cache
# def test_cache_basic_set_get():
# """test basic cache set/get"""
# ... |
baidu/CUP | https://github.com/baidu/CUP | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | cup_test/cup_log_test.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:13.310098 | #!/usr/bin/env python
# -*- coding: utf-8 -*
# Copyright: [CUP] - See LICENSE for details.
# Authors: Yang Honggang
"""
:description:
ut for cup.logging
"""
import os
import sys
import logging
_TOP = os.path.abspath(os.path.dirname(os.path.abspath(__file__)) + '/')
_TESTLOG = _TOP + '/testlog'
sys.path.insert(0, _... |
baidu/CUP | https://github.com/baidu/CUP | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | cup_test/cup_service_heartbeat_test.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:13.311271 | #!/usr/bin/env python
# -*- coding: utf-8 -*
# Copyright: [CUP] - See LICENSE for details.
# Authors: Guannan Ma (@mythmgn),
"""
:description:
unittest for cup.services.heartbeat
"""
import os
import sys
import time
_NOW_PATH = os.path.dirname(os.path.abspath(__file__)) + '/'
sys.path.insert(0, _NOW_PATH + '../')... |
baidu/CUP | https://github.com/baidu/CUP | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | cup_test/cup_decorators_test.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:13.335417 | #!/usr/bin/env python
# -*- coding: utf-8 -*
# Copyright: See LICENSE for details.
# Authors: Guannan Ma (@mythmgn),
"""
:description:
"""
from cup import decorators
@decorators.Singleton
class TestD:
def __init__(self) -> None:
"""
"""
def funca(self):
"""
"""
print("t... |
baidu/CUP | https://github.com/baidu/CUP | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | cup_test/manual/cup_storage_obj_test.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:14.063960 | #!/usr/bin/env python
# -*- coding: utf-8 -*
# Copyright: See LICENSE for details.
# Authors: Guannan Ma (@mythmgn),
"""
:description:
"""
from cup.storage import obj
# s3 = obj.S3ObjectSystem(
# {
# 'ak': 'dQL2wNqjcerNJsrobLbK',
# 'sk': 'hfkWQdDB8sMsimgIqZORBsWIZyPzahJtToKZoLCz',
# 'endp... |
baidu/CUP | https://github.com/baidu/CUP | null | null | null | null | 951 | null | null | apache-2.0 | null | null | null | null | null | null | null | cup_test/cup_services_generator.py | null | null | null | null | null | null | Python | 2026-05-04T02:41:14.065015 | #!/usr/bin/env python
# -*- coding: utf-8 -*
# Copyright: [CUP] - See LICENSE for details.
# Authors: Guannan Ma (@mythmgn),
"""
:description:
ut for cup.services.generator
"""
from __future__ import print_function
import os
import sys
import time
from cup import cache
from cup import unittest
from cup.services im... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.