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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
iniwap/AIWriteX | https://github.com/iniwap/AIWriteX | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | src/ai_write_x/web/app.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:16.892662 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import time
import asyncio
from pathlib import Path
from contextlib import asynccontextmanager
from fastapi import FastAPI, Request
from fastapi.staticfiles import StaticFiles
from fastapi.responses import HTMLResponse
from fastapi.templating import Jinja2Templates
from f... |
iniwap/AIWriteX | https://github.com/iniwap/AIWriteX | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | src/ai_write_x/web/state.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:16.954866 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
from typing import Dict, Any
class AppState:
def __init__(self):
self.active_connections: Dict[str, Any] = {}
self.current_process = None
self.log_queue = None
self.is_running = False
self.config = None
# 全局状态实例
app_state = A... |
iniwap/AIWriteX | https://github.com/iniwap/AIWriteX | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | src/ai_write_x/web/webview_gui.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:16.955492 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import webview
import threading
import time
import uvicorn
import asyncio
import platform
from pathlib import Path
import signal
import sys
import os
from src.ai_write_x.web.app import app
from src.ai_write_x.utils import log
from src.ai_write_x.config.config import Confi... |
iniwap/AIWriteX | https://github.com/iniwap/AIWriteX | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | tests/test_aipy_search.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:17.699687 | import sys
import os
# 获取当前文件(b.py)的绝对路径
current_dir = os.path.dirname(os.path.abspath(__file__))
# 找到项目根目录(即 A 和 B 的父目录)
project_root = os.path.dirname(current_dir)
# 将根目录添加到 Python 搜索路径
sys.path.append(project_root)
from src.ai_write_x.tools.search_template import extract_urls_content # noqa 401
if __name__ == ... |
iniwap/AIWriteX | https://github.com/iniwap/AIWriteX | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | tests/test_hotnews.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:18.423045 | import sys
import os
# 获取当前文件(b.py)的绝对路径
current_dir = os.path.dirname(os.path.abspath(__file__))
# 找到项目根目录(即 A 和 B 的父目录)
project_root = os.path.dirname(current_dir)
# 将根目录添加到 Python 搜索路径
sys.path.append(project_root)
from src.ai_write_x.utils import log # noqa 402
from src.ai_write_x.tools.hotnews import select_pla... |
OpenBMB/RepoAgent | https://github.com/OpenBMB/RepoAgent | null | null | null | null | 954 | null | null | apache-2.0 | null | null | null | null | null | null | null | repo_agent/chat_with_repo/gradio_interface.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:20.822107 | import gradio as gr
import markdown
from repo_agent.log import logger
class GradioInterface:
def __init__(self, respond_function):
self.respond = respond_function
self.cssa = """
<style>
.outer-box {
border: 1px solid #333; /* 外框... |
OpenBMB/RepoAgent | https://github.com/OpenBMB/RepoAgent | null | null | null | null | 954 | null | null | apache-2.0 | null | null | null | null | null | null | null | display/book_tools/generate_repoagent_books.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:20.834070 | import os
import shutil
import sys
def main():
markdown_docs_folder = sys.argv[1]
book_name = sys.argv[2]
repo_path = sys.argv[3]
# mkdir the book folder
dst_dir = os.path.join('./books', book_name, 'src')
docs_dir = os.path.join(repo_path, markdown_docs_folder)
# check the dst_dir
i... |
OpenBMB/RepoAgent | https://github.com/OpenBMB/RepoAgent | null | null | null | null | 954 | null | null | apache-2.0 | null | null | null | null | null | null | null | repo_agent/change_detector.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:20.850637 | import os
import re
import subprocess
import git
from colorama import Fore, Style
from repo_agent.file_handler import FileHandler
from repo_agent.settings import SettingsManager
class ChangeDetector:
"""
这个类需要处理文件的差异和变更检测,它可能会用到 FileHandler 类来访问文件系统。
ChangeDetector 类的核心在于能够识别自上次提交以来文件的变更。
"""
d... |
OpenBMB/RepoAgent | https://github.com/OpenBMB/RepoAgent | null | null | null | null | 954 | null | null | apache-2.0 | null | null | null | null | null | null | null | repo_agent/chat_engine.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:20.852388 | from llama_index.llms.openai_like import OpenAILike
from repo_agent.doc_meta_info import DocItem
from repo_agent.log import logger
from repo_agent.prompt import chat_template
from repo_agent.settings import SettingsManager
class ChatEngine:
"""
ChatEngine is used to generate the doc of functions or classes.
... |
OpenBMB/RepoAgent | https://github.com/OpenBMB/RepoAgent | null | null | null | null | 954 | null | null | apache-2.0 | null | null | null | null | null | null | null | display/book_tools/generate_summary_from_book.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:20.856695 | import os
import re
import sys
def create_readme_if_not_exist(dire):
readme_path = os.path.join(dire, 'README.md')
if not os.path.exists(readme_path):
with open(readme_path, 'w') as readme_file:
dirname = os.path.basename(dire)
readme_file.write('# {}\n'.format(dirname))
# d... |
OpenBMB/RepoAgent | https://github.com/OpenBMB/RepoAgent | null | null | null | null | 954 | null | null | apache-2.0 | null | null | null | null | null | null | null | repo_agent/chat_with_repo/json_handler.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:20.857699 | import json
import sys
from repo_agent.log import logger
class JsonFileProcessor:
def __init__(self, file_path):
self.file_path = file_path
def read_json_file(self):
try:
with open(self.file_path, "r", encoding="utf-8") as file:
data = json.load(file)
... |
OpenBMB/RepoAgent | https://github.com/OpenBMB/RepoAgent | null | null | null | null | 954 | null | null | apache-2.0 | null | null | null | null | null | null | null | repo_agent/chat_with_repo/text_analysis_tool.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:21.426746 | from llama_index.core.llms.function_calling import FunctionCallingLLM
from llama_index.llms.openai import OpenAI
from repo_agent.chat_with_repo.json_handler import JsonFileProcessor
class TextAnalysisTool:
def __init__(self, llm: FunctionCallingLLM, db_path):
self.jsonsearch = JsonFileProcessor(db_path)
... |
OpenBMB/RepoAgent | https://github.com/OpenBMB/RepoAgent | null | null | null | null | 954 | null | null | apache-2.0 | null | null | null | null | null | null | null | repo_agent/chat_with_repo/main.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:21.429664 | import time
from repo_agent.chat_with_repo.gradio_interface import GradioInterface
from repo_agent.chat_with_repo.rag import RepoAssistant
from repo_agent.log import logger
from repo_agent.settings import SettingsManager
def main():
logger.info("Initializing the RepoAgent chat with doc module.")
# Load sett... |
OpenBMB/RepoAgent | https://github.com/OpenBMB/RepoAgent | null | null | null | null | 954 | null | null | apache-2.0 | null | null | null | null | null | null | null | repo_agent/chat_with_repo/rag.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:21.456586 | import json
from llama_index.llms.openai import OpenAI
from repo_agent.chat_with_repo.json_handler import JsonFileProcessor
from repo_agent.chat_with_repo.prompt import (
query_generation_template,
rag_ar_template,
rag_template,
relevance_ranking_chat_template,
)
from repo_agent.chat_with_repo.text_an... |
OpenBMB/RepoAgent | https://github.com/OpenBMB/RepoAgent | null | null | null | null | 954 | null | null | apache-2.0 | null | null | null | null | null | null | null | repo_agent/log.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:21.466508 | # repo_agent/log.py
import inspect
import logging
import sys
from loguru import logger
logger = logger.opt(colors=True)
"""
RepoAgent 日志记录器对象。
默认信息:
- 格式: `[%(asctime)s %(name)s] %(levelname)s: %(message)s`
- 等级: `INFO` ,根据 `CONFIG["log_level"]` 配置改变
- 输出: 输出至 stdout
用法示例:
```python
from repo_agent.log impo... |
OpenBMB/RepoAgent | https://github.com/OpenBMB/RepoAgent | null | null | null | null | 954 | null | null | apache-2.0 | null | null | null | null | null | null | null | repo_agent/chat_with_repo/prompt.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:21.485835 | from llama_index.core import ChatPromptTemplate, PromptTemplate
from llama_index.core.llms import ChatMessage, MessageRole
# Query Generation Prompt
query_generation_prompt_str = (
"You are a helpful assistant that generates multiple search queries based on a "
"single input query. Generate {num_queries} searc... |
OpenBMB/RepoAgent | https://github.com/OpenBMB/RepoAgent | null | null | null | null | 954 | null | null | apache-2.0 | null | null | null | null | null | null | null | repo_agent/chat_with_repo/vector_store_manager.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:21.486353 | import chromadb
from llama_index.core import (
Document,
StorageContext,
VectorStoreIndex,
get_response_synthesizer,
)
from llama_index.core.node_parser import (
SemanticSplitterNodeParser,
SentenceSplitter,
)
from llama_index.core.query_engine import RetrieverQueryEngine
from llama_index.core.r... |
OpenBMB/RepoAgent | https://github.com/OpenBMB/RepoAgent | null | null | null | null | 954 | null | null | apache-2.0 | null | null | null | null | null | null | null | repo_agent/main.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:21.494519 | from importlib import metadata
import click
from pydantic import ValidationError
from repo_agent.doc_meta_info import DocItem, MetaInfo
from repo_agent.log import logger, set_logger_level_from_config
from repo_agent.runner import Runner, delete_fake_files
from repo_agent.settings import SettingsManager, LogLevel
from... |
OpenBMB/RepoAgent | https://github.com/OpenBMB/RepoAgent | null | null | null | null | 954 | null | null | apache-2.0 | null | null | null | null | null | null | null | repo_agent/doc_meta_info.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:21.500857 | """存储doc对应的信息,同时处理引用的关系"""
from __future__ import annotations
import json
import os
import threading
from dataclasses import dataclass, field
from enum import Enum, auto, unique
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional
import jedi
from colorama import Fore, Style
from prettytab... |
OpenBMB/RepoAgent | https://github.com/OpenBMB/RepoAgent | null | null | null | null | 954 | null | null | apache-2.0 | null | null | null | null | null | null | null | repo_agent/multi_task_dispatch.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:21.511840 | from __future__ import annotations
import random
import threading
import time
from typing import Any, Callable, Dict, List
from colorama import Fore, Style
class Task:
def __init__(self, task_id: int, dependencies: List[Task], extra_info: Any = None):
self.task_id = task_id
self.extra_info = ext... |
OpenBMB/RepoAgent | https://github.com/OpenBMB/RepoAgent | null | null | null | null | 954 | null | null | apache-2.0 | null | null | null | null | null | null | null | repo_agent/file_handler.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:21.532416 | # FileHandler 类,实现对文件的读写操作,这里的文件包括markdown文件和python文件
# repo_agent/file_handler.py
import ast
import json
import os
import git
from colorama import Fore, Style
from tqdm import tqdm
from repo_agent.log import logger
from repo_agent.settings import SettingsManager
from repo_agent.utils.gitignore_checker import Gitigno... |
OpenBMB/RepoAgent | https://github.com/OpenBMB/RepoAgent | null | null | null | null | 954 | null | null | apache-2.0 | null | null | null | null | null | null | null | repo_agent/settings.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:22.031331 | from enum import StrEnum
from typing import Optional
from iso639 import Language, LanguageNotFoundError
from pydantic import (
DirectoryPath,
Field,
HttpUrl,
PositiveFloat,
PositiveInt,
SecretStr,
field_validator,
)
from pydantic_settings import BaseSettings
from pathlib import Path
class... |
OpenBMB/RepoAgent | https://github.com/OpenBMB/RepoAgent | null | null | null | null | 954 | null | null | apache-2.0 | null | null | null | null | null | null | null | repo_agent/prompt.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:22.040403 | from llama_index.core import ChatPromptTemplate
from llama_index.core.llms import ChatMessage, MessageRole
doc_generation_instruction = (
"You are an AI documentation assistant, and your task is to generate documentation based on the given code of an object. "
"The purpose of the documentation is to help devel... |
OpenBMB/RepoAgent | https://github.com/OpenBMB/RepoAgent | null | null | null | null | 954 | null | null | apache-2.0 | null | null | null | null | null | null | null | repo_agent/runner.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:22.041262 | import json
import os
import shutil
import subprocess
import threading
import time
from concurrent.futures import ThreadPoolExecutor
from functools import partial
from pathlib import Path
from colorama import Fore, Style
from tqdm import tqdm
from repo_agent.change_detector import ChangeDetector
from repo_agent.chat_... |
OpenBMB/RepoAgent | https://github.com/OpenBMB/RepoAgent | null | null | null | null | 954 | null | null | apache-2.0 | null | null | null | null | null | null | null | repo_agent/project_manager.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:22.084807 | import os
import jedi
class ProjectManager:
def __init__(self, repo_path, project_hierarchy):
self.repo_path = repo_path
self.project = jedi.Project(self.repo_path)
self.project_hierarchy = os.path.join(
self.repo_path, project_hierarchy, "project_hierarchy.json"
)
... |
OpenBMB/RepoAgent | https://github.com/OpenBMB/RepoAgent | null | null | null | null | 954 | null | null | apache-2.0 | null | null | null | null | null | null | null | repo_agent/utils/meta_info_utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:22.097772 | import itertools
import os
import git
from colorama import Fore, Style
from repo_agent.log import logger
from repo_agent.settings import SettingsManager
latest_verison_substring = "_latest_version.py"
def make_fake_files():
"""根据git status检测暂存区信息。如果有文件:
1. 新增文件,没有add。无视
2. 修改文件内容,没有add,原始文件重命名为fake_fil... |
OpenBMB/RepoAgent | https://github.com/OpenBMB/RepoAgent | null | null | null | null | 954 | null | null | apache-2.0 | null | null | null | null | null | null | null | tests/test_change_detector.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:22.098615 | import os
import unittest
from git import Repo
from repo_agent.change_detector import ChangeDetector
class TestChangeDetector(unittest.TestCase):
@classmethod
def setUpClass(cls):
# 定义测试仓库的路径
cls.test_repo_path = os.path.join(os.path.dirname(__file__), 'test_repo')
# 如果测试仓库文件夹不存在,则创... |
OpenBMB/RepoAgent | https://github.com/OpenBMB/RepoAgent | null | null | null | null | 954 | null | null | apache-2.0 | null | null | null | null | null | null | null | tests/test_json_handler.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:22.128407 | import unittest
from unittest.mock import mock_open, patch
from ..repo_agent.chat_with_repo.json_handler import (
JsonFileProcessor, # Adjust the import according to your project structure
)
class TestJsonFileProcessor(unittest.TestCase):
def setUp(self):
self.processor = JsonFileProcessor("test.js... |
OpenBMB/RepoAgent | https://github.com/OpenBMB/RepoAgent | null | null | null | null | 954 | null | null | apache-2.0 | null | null | null | null | null | null | null | repo_agent/utils/gitignore_checker.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:22.129195 | import fnmatch
import os
class GitignoreChecker:
def __init__(self, directory: str, gitignore_path: str):
"""
Initialize the GitignoreChecker with a specific directory and the path to a .gitignore file.
Args:
directory (str): The directory to be checked.
gitignore_... |
OpenBMB/RepoAgent | https://github.com/OpenBMB/RepoAgent | null | null | null | null | 954 | null | null | apache-2.0 | null | null | null | null | null | null | null | tests/test_structure_tree.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:22.147341 | import os
from collections import defaultdict
def build_path_tree(who_reference_me, reference_who, doc_item_path):
def tree():
return defaultdict(tree)
path_tree = tree()
for path_list in [who_reference_me, reference_who]:
for path in path_list:
parts = path.split(os.sep)
... |
mbzuai-oryx/groundingLMM | https://github.com/mbzuai-oryx/groundingLMM | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | GranD/level_1_inference/2_depth_maps/midas/backbones/swin.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:30.218667 | import timm
from .swin_common import _make_swin_backbone
def _make_pretrained_swinl12_384(pretrained, hooks=None):
model = timm.create_model("swin_large_patch4_window12_384", pretrained=pretrained)
hooks = [1, 1, 17, 1] if hooks == None else hooks
return _make_swin_backbone(
model,
hooks... |
mbzuai-oryx/groundingLMM | https://github.com/mbzuai-oryx/groundingLMM | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | GranD/level_1_inference/2_depth_maps/midas/backbones/beit.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:30.219206 | import timm
import torch
import types
import numpy as np
import torch.nn.functional as F
from .utils import forward_adapted_unflatten, make_backbone_default
from timm.models.beit import gen_relative_position_index
from torch.utils.checkpoint import checkpoint
from typing import Optional
def forward_beit(pretrained,... |
mbzuai-oryx/groundingLMM | https://github.com/mbzuai-oryx/groundingLMM | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | GranD/level_1_inference/2_depth_maps/midas/backbones/swin2.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:30.221891 | import timm
from .swin_common import _make_swin_backbone
def _make_pretrained_swin2l24_384(pretrained, hooks=None):
model = timm.create_model("swinv2_large_window12to24_192to384_22kft1k", pretrained=pretrained)
hooks = [1, 1, 17, 1] if hooks == None else hooks
return _make_swin_backbone(
model,
... |
mbzuai-oryx/groundingLMM | https://github.com/mbzuai-oryx/groundingLMM | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | GranD/level_1_inference/1_landmark_categorization/infer.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:30.222824 | import json
import os
import argparse
import torch
from llava.constants import IMAGE_TOKEN_INDEX, DEFAULT_IMAGE_TOKEN, DEFAULT_IM_START_TOKEN, DEFAULT_IM_END_TOKEN
from llava.conversation import conv_templates, SeparatorStyle
from llava.model.builder import load_pretrained_model
from llava.mm_utils import tokenizer_ima... |
mbzuai-oryx/groundingLMM | https://github.com/mbzuai-oryx/groundingLMM | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | GranD/level_1_inference/2_depth_maps/infer.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:30.226480 | import torch
from tqdm import tqdm
import argparse
from pathlib import Path
from torch.utils.data import DataLoader, DistributedSampler
import numpy as np
from midas.model_loader import default_models, load_model
from ddp import *
import utils
import time
first_execution = True
def parse_args():
parser = argpars... |
mbzuai-oryx/groundingLMM | https://github.com/mbzuai-oryx/groundingLMM | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | GranD/level_1_inference/2_depth_maps/midas/backbones/utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:30.227641 | import torch
import torch.nn as nn
class Slice(nn.Module):
def __init__(self, start_index=1):
super(Slice, self).__init__()
self.start_index = start_index
def forward(self, x):
return x[:, self.start_index:]
class AddReadout(nn.Module):
def __init__(self, start_index=1):
... |
mbzuai-oryx/groundingLMM | https://github.com/mbzuai-oryx/groundingLMM | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | GranD/level_1_inference/2_depth_maps/midas/backbones/levit.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:30.242275 | import timm
import torch
import torch.nn as nn
import numpy as np
from .utils import activations, get_activation, Transpose
def forward_levit(pretrained, x):
pretrained.model.forward_features(x)
layer_1 = pretrained.activations["1"]
layer_2 = pretrained.activations["2"]
layer_3 = pretrained.activati... |
mbzuai-oryx/groundingLMM | https://github.com/mbzuai-oryx/groundingLMM | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | GranD/level_1_inference/2_depth_maps/ddp.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:30.243356 | import os
from torch.utils.data import Dataset
import torch
import subprocess
import utils
import cv2
from midas.transforms import Resize, NormalizeImage, PrepareForNet
from torchvision.transforms import Compose
class CustomImageDataset(Dataset):
def __init__(self, image_dir_path):
self.image_paths = []
... |
mbzuai-oryx/groundingLMM | https://github.com/mbzuai-oryx/groundingLMM | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | GranD/level_1_inference/2_depth_maps/midas/backbones/next_vit.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:30.244726 | import timm
import torch.nn as nn
from pathlib import Path
from .utils import activations, forward_default, get_activation
from ..external.next_vit.classification.nextvit import *
def forward_next_vit(pretrained, x):
return forward_default(pretrained, x, "forward")
def _make_next_vit_backbone(
model,... |
mbzuai-oryx/groundingLMM | https://github.com/mbzuai-oryx/groundingLMM | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | GranD/level_1_inference/2_depth_maps/midas/backbones/swin_common.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:30.275687 | import torch
import torch.nn as nn
import numpy as np
from .utils import activations, forward_default, get_activation, Transpose
def forward_swin(pretrained, x):
return forward_default(pretrained, x)
def _make_swin_backbone(
model,
hooks=[1, 1, 17, 1],
patch_grid=[96, 96]
):
pretra... |
mbzuai-oryx/groundingLMM | https://github.com/mbzuai-oryx/groundingLMM | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | GranD/level_1_inference/2_depth_maps/midas/backbones/vit.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:30.872617 | import torch
import torch.nn as nn
import timm
import types
import math
import torch.nn.functional as F
from .utils import (activations, forward_adapted_unflatten, get_activation, get_readout_oper,
make_backbone_default, Transpose)
def forward_vit(pretrained, x):
return forward_adapted_unflat... |
mbzuai-oryx/groundingLMM | https://github.com/mbzuai-oryx/groundingLMM | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | GranD/level_1_inference/2_depth_maps/midas/base_model.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:30.873733 | import torch
class BaseModel(torch.nn.Module):
def load(self, path):
"""Load model from file.
Args:
path (str): file path
"""
parameters = torch.load(path, map_location=torch.device('cpu'))
if "optimizer" in parameters:
parameters = parameters["mod... |
mbzuai-oryx/groundingLMM | https://github.com/mbzuai-oryx/groundingLMM | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | GranD/level_1_inference/2_depth_maps/midas/dpt_depth.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:30.875279 | import torch
import torch.nn as nn
from .base_model import BaseModel
from .blocks import (
FeatureFusionBlock_custom,
Interpolate,
_make_encoder,
forward_beit,
forward_swin,
forward_levit,
forward_vit,
)
from .backbones.levit import stem_b4_transpose
from timm.models.layers import get_act_l... |
mbzuai-oryx/groundingLMM | https://github.com/mbzuai-oryx/groundingLMM | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | GranD/level_1_inference/2_depth_maps/midas/transforms.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:30.883329 | import numpy as np
import cv2
import math
def apply_min_size(sample, size, image_interpolation_method=cv2.INTER_AREA):
"""Rezise the sample to ensure the given size. Keeps aspect ratio.
Args:
sample (dict): sample
size (tuple): image size
Returns:
tuple: new size
"""
shap... |
mbzuai-oryx/groundingLMM | https://github.com/mbzuai-oryx/groundingLMM | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | GranD/level_1_inference/2_depth_maps/midas/blocks.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:30.884539 | import torch
import torch.nn as nn
from .backbones.beit import (
_make_pretrained_beitl16_512,
_make_pretrained_beitl16_384,
_make_pretrained_beitb16_384,
forward_beit,
)
from .backbones.swin_common import (
forward_swin,
)
from .backbones.swin2 import (
_make_pretrained_swin2l24_384,
_make... |
mbzuai-oryx/groundingLMM | https://github.com/mbzuai-oryx/groundingLMM | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | GranD/level_1_inference/2_depth_maps/midas/midas_net_custom.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:30.908008 | """MidashNet: Network for monocular depth estimation trained by mixing several datasets.
This file contains code that is adapted from
https://github.com/thomasjpfan/pytorch_refinenet/blob/master/pytorch_refinenet/refinenet/refinenet_4cascade.py
"""
import torch
import torch.nn as nn
from .base_model import BaseModel
f... |
mbzuai-oryx/groundingLMM | https://github.com/mbzuai-oryx/groundingLMM | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | GranD/level_1_inference/2_depth_maps/midas/model_loader.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:30.909347 | import cv2
import torch
from midas.dpt_depth import DPTDepthModel
from midas.midas_net import MidasNet
from midas.midas_net_custom import MidasNet_small
from midas.transforms import Resize, NormalizeImage, PrepareForNet
from torchvision.transforms import Compose
default_models = {
"dpt_beit_large_512": "weights/... |
mbzuai-oryx/groundingLMM | https://github.com/mbzuai-oryx/groundingLMM | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | GranD/level_1_inference/2_depth_maps/midas/midas_net.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:30.937775 | """MidashNet: Network for monocular depth estimation trained by mixing several datasets.
This file contains code that is adapted from
https://github.com/thomasjpfan/pytorch_refinenet/blob/master/pytorch_refinenet/refinenet/refinenet_4cascade.py
"""
import torch
import torch.nn as nn
from .base_model import BaseModel
f... |
mbzuai-oryx/groundingLMM | https://github.com/mbzuai-oryx/groundingLMM | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | GranD/level_1_inference/3_image_tagging/ddp.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:30.939377 | import os
from torch.utils.data import Dataset
import torch
import subprocess
from PIL import Image, UnidentifiedImageError, ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True
from ram import get_transform
class CustomImageDataset(Dataset):
def __init__(self, image_dir_path, input_size):
self.image_paths =... |
mbzuai-oryx/groundingLMM | https://github.com/mbzuai-oryx/groundingLMM | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | GranD/level_1_inference/2_depth_maps/utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:30.939947 | import re
import numpy as np
import cv2
def read_image(path):
"""Read image and output RGB image (0-1).
Args:
path (str): path to file
Returns:
array: RGB image (0-1)
"""
img = cv2.imread(path)
if img.ndim == 2:
img = cv2.cvtColor(img, cv2.COLOR_GRAY2BGR)
img = ... |
mbzuai-oryx/groundingLMM | https://github.com/mbzuai-oryx/groundingLMM | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | GranD/level_1_inference/3_image_tagging/infer.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:31.490975 | from argparse import ArgumentParser
from pathlib import Path
from typing import Dict, List, Optional, TextIO, Tuple
import json
import torch
from torch import Tensor
from torch.nn import Module, Parameter
from torch.nn.functional import relu, sigmoid
from torch.utils.data import DataLoader, DistributedSampler
from tqdm... |
mbzuai-oryx/groundingLMM | https://github.com/mbzuai-oryx/groundingLMM | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | GranD/level_1_inference/3_image_tagging/ram/models/ram.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:31.515144 | '''
* The Recognize Anything Model (RAM)
* Written by Xinyu Huang
'''
import json
import warnings
import numpy as np
import torch
from torch import nn
from .bert import BertConfig, BertLMHeadModel, BertModel
from .swin_transformer import SwinTransformer
from .utils import *
warnings.filterwarnings("ignore")
cla... |
mbzuai-oryx/groundingLMM | https://github.com/mbzuai-oryx/groundingLMM | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | GranD/level_1_inference/3_image_tagging/ram/models/bert.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:31.531480 | '''
* Copyright (c) 2022, salesforce.com, inc.
* All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
* By Junnan Li
* Based on huggingface code base
* https://github.com/huggingface/transformer... |
mbzuai-oryx/groundingLMM | https://github.com/mbzuai-oryx/groundingLMM | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | GranD/level_1_inference/3_image_tagging/ram/models/swin_transformer.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:31.538085 | # --------------------------------------------------------
# Swin Transformer
# Copyright (c) 2021 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ze Liu
# --------------------------------------------------------
import numpy as np
from scipy import interpolate
import torch
import to... |
mbzuai-oryx/groundingLMM | https://github.com/mbzuai-oryx/groundingLMM | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | GranD/level_1_inference/3_image_tagging/ram/models/tag2text.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:31.553780 | '''
* The Tag2Text Model
* Written by Xinyu Huang
'''
import numpy as np
import json
import torch
import warnings
from torch import nn
from .bert import BertConfig, BertModel, BertLMHeadModel
from .swin_transformer import SwinTransformer
from .utils import *
warnings.filterwarnings("ignore")
class Tag2Text(nn.Mo... |
mbzuai-oryx/groundingLMM | https://github.com/mbzuai-oryx/groundingLMM | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | GranD/level_1_inference/3_image_tagging/ram/transform.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:31.554341 | from torchvision.transforms import Normalize, Compose, Resize, ToTensor
def get_transform(image_size=384):
return Compose([
lambda image: image.convert("RGB"),
Resize((image_size, image_size)),
ToTensor(),
Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
])
|
mbzuai-oryx/groundingLMM | https://github.com/mbzuai-oryx/groundingLMM | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | GranD/level_1_inference/3_image_tagging/ram/models/vit.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:31.558774 | '''
* Copyright (c) 2022, salesforce.com, inc.
* All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
* By Junnan Li
* Based on timm code base
* https://github.com/rwightman/pytorch-image-models... |
mbzuai-oryx/groundingLMM | https://github.com/mbzuai-oryx/groundingLMM | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | GranD/level_1_inference/3_image_tagging/ram/models/utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:31.588329 | import os
import json
import torch
import math
from torch import nn
from typing import List
from transformers import BertTokenizer
from urllib.parse import urlparse
from timm.models.hub import download_cached_file
from .vit import interpolate_pos_embed
from .swin_transformer import interpolate_relative_pos_embed
from ... |
mbzuai-oryx/groundingLMM | https://github.com/mbzuai-oryx/groundingLMM | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | GranD/level_1_inference/4_co_detr/launch_codetr_multi_gpu_inference.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:32.053383 | import os
import argparse
import subprocess
from multiprocessing import Process
def launch_codetr(image_names_txt_path, gpu_id, image_dir_path, output_dir_path, ckpt_path):
"""Invoke the predict_co-detr.py script."""
os.environ["CUDA_VISIBLE_DEVICES"] = str(gpu_id)
subprocess.run([
"python",
... |
mbzuai-oryx/groundingLMM | https://github.com/mbzuai-oryx/groundingLMM | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | GranD/level_1_inference/4_co_detr/infer.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:32.126167 | import argparse
import os
import json
from mmdet.apis import init_detector, inference_detector
import numpy as np
from tqdm import tqdm
import time
class_names = ['person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus', 'train', 'truck', 'boat', 'traffic_light',
'fire_hydrant', 'stop_sign', 'parking... |
mbzuai-oryx/groundingLMM | https://github.com/mbzuai-oryx/groundingLMM | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | GranD/level_1_inference/6_owl_vit/infer.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:32.129956 | import argparse
from transformers import OwlViTProcessor, OwlViTForObjectDetection
import torch
import os
import json
import numpy as np
from PIL import Image, ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True
import cv2
import supervision as sv
from typing import List
from torchvision.ops import box_convert
from tqdm ... |
mbzuai-oryx/groundingLMM | https://github.com/mbzuai-oryx/groundingLMM | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | GranD/level_1_inference/5_eva_02/infer.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:32.132040 | import argparse
import json
import numpy as np
import torch.nn.parallel
from detectron2.checkpoint import DetectionCheckpointer
from detectron2.config import LazyConfig, instantiate
from detectron2.data.detection_utils import read_image
from detectron2.utils.visualizer import _create_text_labels
from torch.utils.data i... |
mbzuai-oryx/groundingLMM | https://github.com/mbzuai-oryx/groundingLMM | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | GranD/level_1_inference/7_pomp/infer.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:32.158715 | import argparse
import torch
import os
import json
import numpy as np
import cv2
from utils import TextEncoder
from tqdm import tqdm
import clip
from detectron2.engine import DefaultPredictor
from detectron2.config import get_cfg
# Detic libraries
from third_party.CenterNet2.centernet.config import add_centernet_confi... |
mbzuai-oryx/groundingLMM | https://github.com/mbzuai-oryx/groundingLMM | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | GranD/level_1_inference/5_eva_02/rle_format.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:32.160803 | # Copyright (c) Meta Platforms, Inc. and affiliates.
# 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 numpy as np
import torch
import math
from copy import deepcopy
from itertools import product
from typing import An... |
mbzuai-oryx/groundingLMM | https://github.com/mbzuai-oryx/groundingLMM | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | GranD/level_1_inference/6_owl_vit/launch_owl_vit_multi_gpu_inference.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:32.170897 | import os
import argparse
import subprocess
from multiprocessing import Process
def launch_owl_vit(image_names_txt_path, gpu_id, image_dir_path, output_dir_path, tags_dir_path):
"""Invoke the predict_owl_vit.py script."""
os.environ["CUDA_VISIBLE_DEVICES"] = str(gpu_id)
subprocess.run([
"python",... |
mbzuai-oryx/groundingLMM | https://github.com/mbzuai-oryx/groundingLMM | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | GranD/level_1_inference/5_eva_02/ddp.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:32.172231 | import os
from torch.utils.data import Dataset
import torch
import subprocess
class CustomImageDataset(Dataset):
def __init__(self, image_dir_path, image_read_func, output_dir_path, transforms=None, model_name = "eva-02-01"):
self.image_paths = []
for image_name in os.listdir(image_dir_path):
... |
mbzuai-oryx/groundingLMM | https://github.com/mbzuai-oryx/groundingLMM | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | GranD/level_1_inference/7_pomp/utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:32.192049 | import torch
import torch.nn as nn
class TextEncoder(nn.Module):
def __init__(self, clip_model):
super().__init__()
self.transformer = clip_model.transformer
self.positional_embedding = clip_model.positional_embedding
self.ln_final = clip_model.ln_final
self.text_projection... |
mbzuai-oryx/groundingLMM | https://github.com/mbzuai-oryx/groundingLMM | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | GranD/level_1_inference/7_pomp/launch_pomp_multi_gpu_inference.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:32.193204 | import os
import argparse
import subprocess
from multiprocessing import Process
def launch_pomp(image_names_txt_path, gpu_id, image_dir_path, output_dir_path, tags_dir_path):
"""Invoke the predict_pomp.py script."""
os.environ["CUDA_VISIBLE_DEVICES"] = str(gpu_id)
subprocess.run([
"python",
... |
mbzuai-oryx/groundingLMM | https://github.com/mbzuai-oryx/groundingLMM | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | GranD/level_1_inference/8_grit/ddp.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:32.723397 | import os
from torch.utils.data import Dataset
import torch
import subprocess
from detectron2.data.detection_utils import read_image
import detectron2.data.transforms as T
class CustomImageDataset(Dataset):
def __init__(self, image_dir_path):
self.image_paths = []
for image_name in os.listdir(imag... |
mbzuai-oryx/groundingLMM | https://github.com/mbzuai-oryx/groundingLMM | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | GranD/level_1_inference/8_grit/models/grit_model.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:32.760082 | from models.grit_src.image_dense_captions import image_caption_dict
class DenseCaptioning():
def __init__(self, device):
self.device = device
def initialize_model(self):
pass
def image_dense_caption_debug(self, image_src):
dense_caption = """
1. the broccoli is green, [0,... |
mbzuai-oryx/groundingLMM | https://github.com/mbzuai-oryx/groundingLMM | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | GranD/level_1_inference/8_grit/infer.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:32.785942 | import argparse
from pathlib import Path
import numpy as np
from tqdm import tqdm
import json
from torch.utils.data import DataLoader, DistributedSampler
from ddp import *
from models.grit_src.image_dense_captions import setup_grit
import time
device = "cuda" if torch.cuda.is_available() else "cpu"
def parse_args():... |
mbzuai-oryx/groundingLMM | https://github.com/mbzuai-oryx/groundingLMM | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | GranD/level_1_inference/8_grit/models/grit_src/grit/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:32.793741 | from .modeling.meta_arch import grit
from .modeling.roi_heads import grit_roi_heads
from .modeling.backbone import vit
from .data.datasets import object365
from .data.datasets import vg
from .data.datasets import grit_coco |
mbzuai-oryx/groundingLMM | https://github.com/mbzuai-oryx/groundingLMM | null | null | null | null | 953 | null | null | apache-2.0 | null | null | null | null | null | null | null | GranD/level_1_inference/8_grit/models/grit_src/grit/config.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:32.794441 | from detectron2.config import CfgNode as CN
def add_grit_config(cfg):
_C = cfg
_C.MODEL.BEAM_SIZE = 1
_C.MODEL.TRAIN_TASK = ["ObjectDet", "DenseCap"]
_C.MODEL.TEST_TASK = "DenseCap" # This can be varied if the model is jointly trained on multiple tasks
_C.MODEL.ROI_BOX_HEAD.USE_BIAS = 0.0 # >= ... |
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/benchmark_batch/benchmark_batch.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:36.266949 | import concurrent.futures
import os
import random
import time
from concurrent.futures import ProcessPoolExecutor
from statistics import mean
import requests
from tqdm import tqdm
from transformers import AutoTokenizer
from sglang.lang.backend.runtime_endpoint import RuntimeEndpoint
##################################... |
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/run_chatbot_sglang.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:36.268804 | """Fast-dVLM sglang chatbot with selectable MDM or speculative decoding."""
import argparse
import os
import sys
# Drop this script's dir from sys.path so `import sglang` resolves to the
# installed package, not the local ./sglang source tree (a namespace pkg).
_HERE = os.path.dirname(os.path.abspath(__file__))
sys.p... |
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/bench_attention_sink/bench_attention_sink_triton.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:36.270292 | import argparse
import torch
import triton
from sglang.srt.layers.attention.triton_ops.decode_attention import (
decode_attention_fwd_grouped,
)
from sglang.srt.layers.attention.triton_ops.extend_attention import extend_attention_fwd
# gpt oss
head_num = 64
head_dim = 64
head_kv_num = 8
@triton.testing.perf_re... |
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/bench_in_batch_prefix/bench_in_batch_prefix.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:36.293524 | # Benchmark with lots of common prefixes. Used to benchmark prefix caching performance.
#
# Launch a server:
# python -m sglang.launch_server --model-path meta-llama/Llama-2-7b-chat-hf --port 30000 --log-level-http warning
import random
import string
import time
from tqdm import tqdm
from transformers import AutoToke... |
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/3rdparty/amd/tuning/benchmark_moe_rocm.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:36.302033 | import argparse
import json
import os
import sys
import torch
import torch.nn.functional as F
import triton
import triton.language as tl
from tqdm import tqdm
from transformers import AutoConfig
from sglang.srt.layers.moe.fused_moe_triton.fused_moe import (
fused_moe,
get_config_file_name,
)
padding_size = 1... |
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/boolq/convert_parquet_to_json.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:36.302730 | import sys
import pyarrow.parquet as pq
def convert_parquet_to_json(input_file, output_file):
# read parquet file
table = pq.read_table(input_file)
# turn parquet data to dataframe
df = table.to_pandas()
# turn dataframe to json form
json_data = df.to_json(orient="records", lines=True)
... |
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/run_chatbot.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:36.327920 | """Fast-dVLM command-line chatbot with speculative block-causal decoding."""
import argparse
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, AutoProcessor
from qwen_vl_utils import process_vision_info
def build_messages(image, prompt):
content = []
if image:
content.append(... |
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/.github/update_ci_permission.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:36.346993 | """
Update the CI permissions configuration file.
This script updates the `CI_PERMISSIONS.json` file, which defines the CI permissions granted to each user.
The format of `CI_PERMISSIONS.json` is as follows:
{
"username1": {
"can_tag_run_ci_label": true,
"can_rerun_failed_ci": true,
"cool... |
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/boolq/bench_sglang.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:36.373243 | import argparse
import json
import time
import numpy as np
from sglang.api import set_default_backend
from sglang.test.test_utils import (
add_common_sglang_args_and_parse,
select_sglang_backend,
)
from sglang.utils import read_jsonl
def get_example(lines, i, answer):
prompt = "Question: " + lines[i]["q... |
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/benchmark_batch/benchmark_tokenizer.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:36.374691 | import random
import time
from statistics import mean
from transformers import AutoTokenizer
# CONFIG
TOKENIZER_DIR = (
"/shared/public/sharing/fait360brew/training/models/meta-llama/Llama-3.2-3B"
)
NUM_TOKENS = 20000 # Each prompt should contain this many tokens
BATCH_SIZES = [1, 2, 4, 8] # Test different batc... |
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/dspy/bench_dspy_intro.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:37.086027 | """
Adapted from
https://github.com/stanfordnlp/dspy/blob/34d8420383ec752037aa271825c1d3bf391e1277/intro.ipynb#L9
"""
import argparse
import dspy
from dspy.datasets import HotPotQA
class BasicQA(dspy.Signature):
"""Answer questions with short factoid answers."""
question = dspy.InputField()
answer = ds... |
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/generative_agents/agent_functions.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:37.087406 | import sglang as sgl
# here are the top five agent functions contributing ~70% LLM calls
# reference: https://github.com/joonspk-research/generative_agents/
@sgl.function
def poignancy_event(s, persona_name, persona_iss, event):
s += "Here is a brief description of " + persona_name + ".\n"
s += persona_iss +... |
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/hellaswag/bench_sglang.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:37.335497 | import argparse
import json
import os
import time
import numpy as np
from sglang.lang.api import set_default_backend
from sglang.test.test_utils import (
add_common_sglang_args_and_parse,
select_sglang_backend,
)
from sglang.utils import download_and_cache_file, read_jsonl
def get_one_example(lines, i, incl... |
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/generative_agents/bench_other.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:37.338640 | import argparse
import json
import time
from agent_functions import (
action_location_object_prompt,
action_location_sector_prompt,
generate_event_triple_prompt,
generate_pronunciatio_prompt,
poignancy_event_prompt,
)
from tqdm import tqdm
from sglang.test.test_utils import add_common_other_args_a... |
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/generative_agents/bench_sglang.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:37.340591 | import argparse
import json
import time
from agent_functions import (
action_location_object,
action_location_sector,
generate_event_triple,
generate_pronunciatio,
poignancy_event,
)
import sglang as sgl
from sglang.test.test_utils import (
add_common_sglang_args_and_parse,
select_sglang_b... |
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/gsm8k/bench_other.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:37.341778 | import argparse
import ast
import asyncio
import json
import re
import time
from concurrent.futures import ThreadPoolExecutor
import numpy as np
from tqdm import tqdm
from sglang.test.test_utils import add_common_other_args_and_parse, get_call_generate
from sglang.utils import download_and_cache_file, dump_state_text... |
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/hellaswag/bench_other.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:37.343038 | import argparse
import asyncio
import json
import time
from concurrent.futures import ThreadPoolExecutor
import numpy as np
from tqdm import tqdm
from sglang.test.test_utils import add_common_other_args_and_parse, get_call_select
from sglang.utils import download_and_cache_file, read_jsonl
def get_one_example(lines... |
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/ceval/bench_sglang.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:37.344284 | import argparse
import json
import os
import random
import re
import time
import numpy as np
from datasets import load_dataset
from sglang.lang.api import set_default_backend
from sglang.test.test_utils import (
add_common_sglang_args_and_parse,
select_sglang_backend,
)
choices = ["A", "B", "C", "D"]
def g... |
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/hf3fs/bench_client.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:37.442110 | import concurrent.futures
import logging
import random
import time
from typing import List
import torch
from tqdm import tqdm
from sglang.srt.mem_cache.storage.hf3fs.hf3fs_usrbio_client import Hf3fsUsrBioClient
def print_stats(x: List[int]):
x = sorted(x)
lenx = len(x)
print(
f"mean = {sum(x)/le... |
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/gsm8k/bench_sglang.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:37.442773 | import argparse
import ast
import json
import os
import re
import time
import numpy as np
from sglang.lang.api import set_default_backend
from sglang.test.test_utils import (
add_common_sglang_args_and_parse,
dump_bench_raw_result,
select_sglang_backend,
)
from sglang.utils import download_and_cache_file,... |
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/hf3fs/bench_storage.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:38.197588 | import json
import logging
import os
import random
import time
from typing import List
import torch
from tqdm import tqdm
from sglang.srt.mem_cache.storage.hf3fs.mini_3fs_metadata_server import (
Hf3fsLocalMetadataClient,
)
from sglang.srt.mem_cache.storage.hf3fs.storage_hf3fs import HiCacheHF3FS
def print_stat... |
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/hf3fs/bench_zerocopy.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:38.198539 | import threading
import time
import torch
from tqdm import tqdm
from sglang.srt.distributed import (
get_world_group,
init_distributed_environment,
initialize_model_parallel,
)
from sglang.srt.managers.cache_controller import (
HiCacheController,
PrefetchOperation,
StorageOperation,
)
from sgl... |
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_long_context.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:38.993567 | import json
import queue
import time
import requests
from bench_multiturn import (
ReadyQueue,
WorkloadGenerator,
gen_payload,
log_to_jsonl_file,
parse_args,
)
from tqdm.asyncio import tqdm
from sglang.bench_serving import get_tokenizer
class ContextWorkloadGenerator(WorkloadGenerator):
def ... |
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_other.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:38.994933 | import argparse
import json
import time
from concurrent.futures import ThreadPoolExecutor
from functools import partial
from tqdm import tqdm
from sglang.lang.ir import REGEX_FLOAT, REGEX_INT, REGEX_STR
from sglang.test.test_utils import add_common_other_args_and_parse, get_call_generate
from sglang.utils import dump... |
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_mix.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:38.996470 | import argparse
import asyncio
import json
import logging
import os
import queue
import random
import threading
import time
from dataclasses import dataclass
from functools import wraps
import aiohttp
from sglang.bench_serving import (
RequestFuncOutput,
get_tokenizer,
remove_prefix,
sample_random_req... |
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/data_processing.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:38.997897 | import json
import os
import pickle
import random
from typing import List, Optional, Tuple, Union
import numpy as np
from nextqa import NExTQALoader
# from nextqa.video import , VideoPrompt
from tqdm.asyncio import tqdm
from transformers import PreTrainedTokenizerBase
from sglang.bench_serving import (
SHAREGPT_... |
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/perf.py | null | null | null | null | null | null | Python | 2026-05-04T02:40:38.999299 | from __future__ import annotations
from typing import Any, Callable, NamedTuple
import torch
def jit_hicache_impl(
k_cache_dst: torch.Tensor,
v_cache_dst: torch.Tensor,
indices_dst: torch.Tensor,
k_cache_src: torch.Tensor,
v_cache_src: torch.Tensor,
indices_src: torch.Tensor,
item_bytes:... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.