SYMBOL INDEX (1301 symbols across 113 files) FILE: fastchat/constants.py class ErrorCode (line 68) | class ErrorCode(IntEnum): FILE: fastchat/conversation.py class SeparatorStyle (line 16) | class SeparatorStyle(IntEnum): class Conversation (line 48) | class Conversation: method get_prompt (line 76) | def get_prompt(self) -> str: method get_images (line 330) | def get_images(self): method set_system_message (line 340) | def set_system_message(self, system_message: str): method get_system_message (line 344) | def get_system_message(self, is_vision=False): method append_message (line 350) | def append_message(self, role: str, message: str): method update_last_message (line 354) | def update_last_message(self, message: str): method to_gradio_chatbot (line 362) | def to_gradio_chatbot(self): method to_openai_vision_api_messages (line 383) | def to_openai_vision_api_messages(self, is_mistral=False): method to_openai_api_messages (line 425) | def to_openai_api_messages(self): method to_gemini_api_messages (line 440) | def to_gemini_api_messages(self): method to_vertex_api_messages (line 464) | def to_vertex_api_messages(self): method to_anthropic_vision_api_messages (line 492) | def to_anthropic_vision_api_messages(self): method to_reka_api_messages (line 532) | def to_reka_api_messages(self): method to_metagen_api_messages (line 586) | def to_metagen_api_messages(self): method save_new_images (line 611) | def save_new_images(self, has_csam_images=False, use_remote_storage=Fa... method extract_text_and_image_hashes_from_messages (line 641) | def extract_text_and_image_hashes_from_messages(self): method copy (line 667) | def copy(self): method dict (line 684) | def dict(self): function register_conv_template (line 698) | def register_conv_template(template: Conversation, override: bool = False): function get_conv_template (line 708) | def get_conv_template(name: str) -> Conversation: FILE: fastchat/data/clean_sharegpt.py function reformat_code (line 31) | def reformat_code(val: str) -> str: function html_to_markdown (line 41) | def html_to_markdown(val: str) -> str: function contain_blocked_words (line 66) | def contain_blocked_words(val: str) -> bool: function contain_blocked_responses (line 74) | def contain_blocked_responses(role: str, val: str) -> bool: function clean_html_one_sample (line 86) | def clean_html_one_sample(sample): function clean_html_all (line 141) | def clean_html_all(content, begin, end): function main (line 218) | def main(args): FILE: fastchat/data/filter_wrong_format.py function should_skip (line 17) | def should_skip(conv): FILE: fastchat/data/get_stats.py function tokenize_one_sample (line 19) | def tokenize_one_sample(c): function tokenize_dataset (line 26) | def tokenize_dataset(content): function compute_stats (line 37) | def compute_stats(content): FILE: fastchat/data/hardcoded_questions.py function identity_questions (line 7) | def identity_questions(): FILE: fastchat/data/optional_clean.py function skip (line 21) | def skip(conv, args): FILE: fastchat/data/optional_replace.py function replace_special_tokens (line 18) | def replace_special_tokens( function replace (line 43) | def replace(conv, tokenizer): FILE: fastchat/data/split_long_conversation.py function make_sample (line 18) | def make_sample(sample, start_idx, end_idx): function split_one_sample (line 30) | def split_one_sample(sample): function worker (line 59) | def worker(input_data): function split_all (line 66) | def split_all(content, begin, end, tokenizer_, max_length_): function filter_invalid_roles (line 86) | def filter_invalid_roles(content): function main (line 105) | def main(args): FILE: fastchat/llm_judge/common.py class Judge (line 59) | class Judge: class MatchSingle (line 67) | class MatchSingle: class MatchPair (line 77) | class MatchPair: function load_questions (line 88) | def load_questions(question_file: str, begin: Optional[int], end: Option... function load_model_answers (line 99) | def load_model_answers(answer_dir: str): function load_judge_prompts (line 121) | def load_judge_prompts(prompt_file: str): function run_judge_single (line 135) | def run_judge_single(question, answer, judge, ref_answer, multi_turn=Fal... function play_a_match_single (line 192) | def play_a_match_single(match: MatchSingle, output_file: str): function run_judge_pair (line 235) | def run_judge_pair(question, answer_a, answer_b, judge, ref_answer, mult... function play_a_match_pair (line 313) | def play_a_match_pair(match: MatchPair, output_file: str): function chat_completion_openai (line 407) | def chat_completion_openai(model, conv, temperature, max_tokens, api_dic... function chat_completion_openai_azure (line 431) | def chat_completion_openai_azure(model, conv, temperature, max_tokens, a... function chat_completion_anthropic (line 470) | def chat_completion_anthropic(model, conv, temperature, max_tokens, api_... function chat_completion_palm (line 496) | def chat_completion_palm(chat_state, model, conv, temperature, max_tokens): function normalize_game_key_single (line 522) | def normalize_game_key_single(gamekey, result): function normalize_game_key_dict (line 537) | def normalize_game_key_dict(judgment_dict): function load_pairwise_model_judgments (line 546) | def load_pairwise_model_judgments(filename: str): function load_single_model_judgments (line 589) | def load_single_model_judgments(filename: str): function resolve_pairwise_judgment_dict (line 614) | def resolve_pairwise_judgment_dict( function resolve_single_judgment_dict (line 629) | def resolve_single_judgment_dict( function get_pairwise_judge_explanation (line 644) | def get_pairwise_judge_explanation(gamekey, judgment_dict): function get_single_judge_explanation (line 669) | def get_single_judge_explanation(gamekey, judgment_dict): function check_data (line 687) | def check_data(questions, model_answers, ref_answers, models, judges): function get_model_list (line 708) | def get_model_list(answer_dir): FILE: fastchat/llm_judge/compute_agreement.py function get_judge_name (line 15) | def get_judge_name(judge): function revert (line 24) | def revert(vote): function get_mt_bench_votes_data (line 32) | def get_mt_bench_votes_data(raw_votes): function convertvote (line 54) | def convertvote(vote): function equalvote (line 60) | def equalvote(vote1, vote2): function get_mt_bench_agreement (line 67) | def get_mt_bench_agreement(data, judge1, judge2, ban): function run_mt_bench_agreement (line 101) | def run_mt_bench_agreement(judges, votefiles): FILE: fastchat/llm_judge/gen_api_answer.py function get_answer (line 27) | def get_answer( FILE: fastchat/llm_judge/gen_judgment.py function make_match (line 27) | def make_match( function make_match_all_pairs (line 68) | def make_match_all_pairs( function make_match_single (line 108) | def make_match_single( function make_judge_pairwise (line 137) | def make_judge_pairwise(judge_model, judge_prompts): function make_judge_single (line 153) | def make_judge_single(judge_model, judge_prompts): function play_a_match_wrapper (line 312) | def play_a_match_wrapper(match): FILE: fastchat/llm_judge/gen_model_answer.py function run_eval (line 21) | def run_eval( function get_model_answers (line 74) | def get_model_answers( function reorg_answer_file (line 193) | def reorg_answer_file(answer_file): FILE: fastchat/llm_judge/qa_browser.py function display_question (line 37) | def display_question(category_selector, request: gr.Request): function display_pairwise_answer (line 45) | def display_pairwise_answer( function display_single_answer (line 84) | def display_single_answer(question_selector, model_selector1, request: g... function post_process_answer (line 117) | def post_process_answer(x): function pairwise_to_gradio_chat_mds (line 125) | def pairwise_to_gradio_chat_mds(question, ans_a, ans_b, turn=None): function single_to_gradio_chat_mds (line 157) | def single_to_gradio_chat_mds(question, ans, turn=None): function build_question_selector_map (line 186) | def build_question_selector_map(): function build_pairwise_browser_tab (line 196) | def build_pairwise_browser_tab(): function build_single_answer_browser_tab (line 269) | def build_single_answer_browser_tab(): function load_demo (line 355) | def load_demo(): function build_demo (line 360) | def build_demo(): FILE: fastchat/llm_judge/show_result.py function display_result_single (line 9) | def display_result_single(args): function display_result_pairwise (line 39) | def display_result_pairwise(args): FILE: fastchat/model/apply_delta.py function split_files (line 25) | def split_files(model_path, tmp_path, split_size): function apply_delta_low_cpu_mem (line 70) | def apply_delta_low_cpu_mem(base_model_path, target_model_path, delta_pa... function apply_delta (line 125) | def apply_delta(base_model_path, target_model_path, delta_path): FILE: fastchat/model/apply_lora.py function apply_lora (line 17) | def apply_lora(base_model_path, target_model_path, lora_path): FILE: fastchat/model/compression.py class CompressionConfig (line 24) | class CompressionConfig: class CLinear (line 39) | class CLinear(nn.Module): method __init__ (line 42) | def __init__(self, weight=None, bias=None, device=None): method forward (line 52) | def forward(self, input: Tensor) -> Tensor: function compress_module (line 59) | def compress_module(module, target_device): function get_compressed_list (line 72) | def get_compressed_list(module, prefix=""): function apply_compressed_weight (line 88) | def apply_compressed_weight(module, compressed_state_dict, target_device... function load_compress_model (line 109) | def load_compress_model(model_path, device, torch_dtype, use_fast, revis... function compress (line 226) | def compress(tensor, config): function decompress (line 279) | def decompress(packed_data, config): FILE: fastchat/model/convert_fp16.py function convert_fp16 (line 11) | def convert_fp16(in_checkpoint, out_checkpoint): FILE: fastchat/model/llama_condense_monkey_patch.py class CondenseRotaryEmbedding (line 10) | class CondenseRotaryEmbedding(torch.nn.Module): method __init__ (line 11) | def __init__( method forward (line 42) | def forward(self, x, seq_len=None): function replace_llama_with_condense (line 68) | def replace_llama_with_condense(ratio): FILE: fastchat/model/make_delta.py function make_delta (line 14) | def make_delta(base_model_path, target_model_path, delta_path): FILE: fastchat/model/model_adapter.py class BaseModelAdapter (line 97) | class BaseModelAdapter: method match (line 102) | def match(self, model_path: str): method load_model (line 105) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method load_compress_model (line 134) | def load_compress_model(self, model_path, device, torch_dtype, revisio... method get_default_conv_template (line 143) | def get_default_conv_template(self, model_path: str) -> Conversation: function register_model_adapter (line 152) | def register_model_adapter(cls): function get_model_adapter (line 158) | def get_model_adapter(model_path: str) -> BaseModelAdapter: function raise_warning_for_incompatible_cpu_offloading_configuration (line 175) | def raise_warning_for_incompatible_cpu_offloading_configuration( function load_model (line 201) | def load_model( function get_conversation_template (line 398) | def get_conversation_template(model_path: str) -> Conversation: function get_generate_stream_function (line 404) | def get_generate_stream_function(model: torch.nn.Module, model_path: str): function add_model_args (line 488) | def add_model_args(parser): function remove_parent_directory_name (line 620) | def remove_parent_directory_name(model_path): class PeftModelAdapter (line 630) | class PeftModelAdapter: method match (line 633) | def match(self, model_path: str): method load_model (line 639) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 688) | def get_default_conv_template(self, model_path: str) -> Conversation: class VicunaAdapter (line 702) | class VicunaAdapter(BaseModelAdapter): method match (line 707) | def match(self, model_path: str): method load_model (line 710) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 723) | def get_default_conv_template(self, model_path: str) -> Conversation: method raise_warning_for_old_weights (line 728) | def raise_warning_for_old_weights(self, model): class AiroborosAdapter (line 740) | class AiroborosAdapter(BaseModelAdapter): method match (line 743) | def match(self, model_path: str): method get_default_conv_template (line 748) | def get_default_conv_template(self, model_path: str) -> Conversation: method load_model (line 755) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): class LongChatAdapter (line 771) | class LongChatAdapter(BaseModelAdapter): method match (line 776) | def match(self, model_path: str): method load_model (line 779) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 796) | def get_default_conv_template(self, model_path: str) -> Conversation: class GoogleT5Adapter (line 800) | class GoogleT5Adapter(BaseModelAdapter): method match (line 803) | def match(self, model_path: str): method load_model (line 809) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): class KoalaAdapter (line 821) | class KoalaAdapter(BaseModelAdapter): method match (line 826) | def match(self, model_path: str): method get_default_conv_template (line 829) | def get_default_conv_template(self, model_path: str) -> Conversation: class AlpacaAdapter (line 833) | class AlpacaAdapter(BaseModelAdapter): method match (line 838) | def match(self, model_path: str): method get_default_conv_template (line 841) | def get_default_conv_template(self, model_path: str) -> Conversation: class ChatGLMAdapter (line 845) | class ChatGLMAdapter(BaseModelAdapter): method match (line 848) | def match(self, model_path: str): method load_model (line 851) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 869) | def get_default_conv_template(self, model_path: str) -> Conversation: class CodeGeexAdapter (line 878) | class CodeGeexAdapter(BaseModelAdapter): method match (line 881) | def match(self, model_path: str): method load_model (line 884) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 894) | def get_default_conv_template(self, model_path: str) -> Conversation: class DollyV2Adapter (line 898) | class DollyV2Adapter(BaseModelAdapter): method match (line 901) | def match(self, model_path: str): method load_model (line 904) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 918) | def get_default_conv_template(self, model_path: str) -> Conversation: class OasstPythiaAdapter (line 922) | class OasstPythiaAdapter(BaseModelAdapter): method match (line 925) | def match(self, model_path: str): method get_default_conv_template (line 929) | def get_default_conv_template(self, model_path: str) -> Conversation: method load_model (line 932) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): class OasstLLaMAAdapter (line 939) | class OasstLLaMAAdapter(BaseModelAdapter): method match (line 944) | def match(self, model_path: str): method get_default_conv_template (line 950) | def get_default_conv_template(self, model_path: str) -> Conversation: class OpenChat35Adapter (line 954) | class OpenChat35Adapter(BaseModelAdapter): method match (line 957) | def match(self, model_path: str): method get_default_conv_template (line 964) | def get_default_conv_template(self, model_path: str) -> Conversation: class TenyxChatAdapter (line 968) | class TenyxChatAdapter(BaseModelAdapter): method match (line 971) | def match(self, model_path: str): method get_default_conv_template (line 974) | def get_default_conv_template(self, model_path: str) -> Conversation: class PythiaAdapter (line 978) | class PythiaAdapter(BaseModelAdapter): method match (line 981) | def match(self, model_path: str): method load_model (line 984) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): class StableLMAdapter (line 991) | class StableLMAdapter(BaseModelAdapter): method match (line 994) | def match(self, model_path: str): method get_default_conv_template (line 997) | def get_default_conv_template(self, model_path: str) -> Conversation: class MPTAdapter (line 1001) | class MPTAdapter(BaseModelAdapter): method match (line 1004) | def match(self, model_path: str): method load_model (line 1008) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 1024) | def get_default_conv_template(self, model_path: str) -> Conversation: class BaizeAdapter (line 1040) | class BaizeAdapter(BaseModelAdapter): method match (line 1045) | def match(self, model_path: str): method get_default_conv_template (line 1048) | def get_default_conv_template(self, model_path: str) -> Conversation: class RwkvAdapter (line 1052) | class RwkvAdapter(BaseModelAdapter): method match (line 1055) | def match(self, model_path: str): method load_model (line 1058) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 1068) | def get_default_conv_template(self, model_path: str) -> Conversation: class OpenBuddyAdapter (line 1072) | class OpenBuddyAdapter(BaseModelAdapter): method match (line 1077) | def match(self, model_path: str): method get_default_conv_template (line 1080) | def get_default_conv_template(self, model_path: str) -> Conversation: class PhoenixAdapter (line 1084) | class PhoenixAdapter(BaseModelAdapter): method match (line 1087) | def match(self, model_path: str): method get_default_conv_template (line 1090) | def get_default_conv_template(self, model_path: str) -> Conversation: class ReaLMAdapter (line 1094) | class ReaLMAdapter(BaseModelAdapter): method match (line 1097) | def match(self, model_path: str): method load_model (line 1100) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 1107) | def get_default_conv_template(self, model_path: str) -> Conversation: class ChatGPTAdapter (line 1111) | class ChatGPTAdapter(BaseModelAdapter): method match (line 1114) | def match(self, model_path: str): method load_model (line 1117) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 1120) | def get_default_conv_template(self, model_path: str) -> Conversation: class AzureOpenAIAdapter (line 1144) | class AzureOpenAIAdapter(BaseModelAdapter): method match (line 1147) | def match(self, model_path: str): method load_model (line 1150) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 1153) | def get_default_conv_template(self, model_path: str) -> Conversation: class PplxAIAdapter (line 1157) | class PplxAIAdapter(BaseModelAdapter): method match (line 1160) | def match(self, model_path: str): method load_model (line 1166) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 1169) | def get_default_conv_template(self, model_path: str) -> Conversation: class ClaudeAdapter (line 1173) | class ClaudeAdapter(BaseModelAdapter): method match (line 1176) | def match(self, model_path: str): method load_model (line 1179) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 1182) | def get_default_conv_template(self, model_path: str) -> Conversation: class BardAdapter (line 1194) | class BardAdapter(BaseModelAdapter): method match (line 1197) | def match(self, model_path: str): method load_model (line 1200) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 1203) | def get_default_conv_template(self, model_path: str) -> Conversation: class PaLM2Adapter (line 1207) | class PaLM2Adapter(BaseModelAdapter): method match (line 1210) | def match(self, model_path: str): method load_model (line 1213) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 1216) | def get_default_conv_template(self, model_path: str) -> Conversation: class GeminiAdapter (line 1220) | class GeminiAdapter(BaseModelAdapter): method match (line 1223) | def match(self, model_path: str): method load_model (line 1226) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 1229) | def get_default_conv_template(self, model_path: str) -> Conversation: method match (line 2238) | def match(self, model_path: str): method load_model (line 2241) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 2244) | def get_default_conv_template(self, model_path: str) -> Conversation: class BiLLaAdapter (line 1233) | class BiLLaAdapter(BaseModelAdapter): method match (line 1236) | def match(self, model_path: str): method get_default_conv_template (line 1239) | def get_default_conv_template(self, model_path: str) -> Conversation: class RedPajamaINCITEAdapter (line 1243) | class RedPajamaINCITEAdapter(BaseModelAdapter): method match (line 1246) | def match(self, model_path: str): method load_model (line 1249) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 1259) | def get_default_conv_template(self, model_path: str) -> Conversation: class H2OGPTAdapter (line 1263) | class H2OGPTAdapter(BaseModelAdapter): method match (line 1268) | def match(self, model_path: str): method get_default_conv_template (line 1271) | def get_default_conv_template(self, model_path: str) -> Conversation: class RobinAdapter (line 1275) | class RobinAdapter(BaseModelAdapter): method match (line 1280) | def match(self, model_path: str): method get_default_conv_template (line 1283) | def get_default_conv_template(self, model_path: str) -> Conversation: class SnoozyAdapter (line 1287) | class SnoozyAdapter(BaseModelAdapter): method match (line 1292) | def match(self, model_path: str): method get_default_conv_template (line 1296) | def get_default_conv_template(self, model_path: str) -> Conversation: class WizardLMAdapter (line 1300) | class WizardLMAdapter(BaseModelAdapter): method match (line 1305) | def match(self, model_path: str): method get_default_conv_template (line 1308) | def get_default_conv_template(self, model_path: str) -> Conversation: class ManticoreAdapter (line 1318) | class ManticoreAdapter(BaseModelAdapter): method match (line 1323) | def match(self, model_path: str): method get_default_conv_template (line 1326) | def get_default_conv_template(self, model_path: str) -> Conversation: class GuanacoAdapter (line 1330) | class GuanacoAdapter(BaseModelAdapter): method match (line 1335) | def match(self, model_path: str): method load_model (line 1338) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 1350) | def get_default_conv_template(self, model_path: str) -> Conversation: class ChangGPTAdapter (line 1354) | class ChangGPTAdapter(BaseModelAdapter): method match (line 1357) | def match(self, model_path: str): method get_default_conv_template (line 1361) | def get_default_conv_template(self, model_path: str) -> Conversation: class CamelAdapter (line 1365) | class CamelAdapter(BaseModelAdapter): method match (line 1370) | def match(self, model_path: str): method get_default_conv_template (line 1373) | def get_default_conv_template(self, model_path: str) -> Conversation: class TuluAdapter (line 1377) | class TuluAdapter(BaseModelAdapter): method match (line 1382) | def match(self, model_path: str): method get_default_conv_template (line 1385) | def get_default_conv_template(self, model_path: str) -> Conversation: class FalconAdapter (line 1389) | class FalconAdapter(BaseModelAdapter): method match (line 1392) | def match(self, model_path: str): method load_model (line 1395) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 1410) | def get_default_conv_template(self, model_path: str) -> Conversation: class FalconChatAdapter (line 1414) | class FalconChatAdapter(BaseModelAdapter): method match (line 1415) | def match(self, model_path: str): method get_default_conv_template (line 1418) | def get_default_conv_template(self, model_path: str) -> Conversation: class TigerBotAdapter (line 1422) | class TigerBotAdapter(BaseModelAdapter): method match (line 1425) | def match(self, model_path: str): method load_model (line 1428) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 1443) | def get_default_conv_template(self, model_path: str) -> Conversation: class BaichuanAdapter (line 1447) | class BaichuanAdapter(BaseModelAdapter): method match (line 1450) | def match(self, model_path: str): method load_model (line 1453) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 1466) | def get_default_conv_template(self, model_path: str) -> Conversation: class XGenAdapter (line 1475) | class XGenAdapter(BaseModelAdapter): method match (line 1478) | def match(self, model_path: str): method load_model (line 1481) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 1495) | def get_default_conv_template(self, model_path: str) -> Conversation: class NousHermesAdapter (line 1499) | class NousHermesAdapter(BaseModelAdapter): method match (line 1504) | def match(self, model_path: str): method get_default_conv_template (line 1507) | def get_default_conv_template(self, model_path: str) -> Conversation: class InternLMChatAdapter (line 1511) | class InternLMChatAdapter(BaseModelAdapter): method match (line 1514) | def match(self, model_path: str): method load_model (line 1517) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 1533) | def get_default_conv_template(self, model_path: str) -> Conversation: class StarChatAdapter (line 1537) | class StarChatAdapter(BaseModelAdapter): method match (line 1540) | def match(self, model_path: str): method get_default_conv_template (line 1543) | def get_default_conv_template(self, model_path: str) -> Conversation: class MistralAdapter (line 1547) | class MistralAdapter(BaseModelAdapter): method match (line 1550) | def match(self, model_path: str): method load_model (line 1553) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 1559) | def get_default_conv_template(self, model_path: str) -> Conversation: class Llama2Adapter (line 1563) | class Llama2Adapter(BaseModelAdapter): method match (line 1566) | def match(self, model_path: str): method load_model (line 1569) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 1575) | def get_default_conv_template(self, model_path: str) -> Conversation: class Llama3Adapter (line 1579) | class Llama3Adapter(BaseModelAdapter): method match (line 1582) | def match(self, model_path: str): method load_model (line 1585) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 1591) | def get_default_conv_template(self, model_path: str) -> Conversation: class Llama31Adapter (line 1595) | class Llama31Adapter(BaseModelAdapter): method match (line 1598) | def match(self, model_path: str): method load_model (line 1606) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 1612) | def get_default_conv_template(self, model_path: str) -> Conversation: class GrokAdapter (line 1622) | class GrokAdapter(BaseModelAdapter): method match (line 1623) | def match(self, model_path: str): method get_default_conv_template (line 1626) | def get_default_conv_template(self, model_path: str) -> Conversation: class CuteGPTAdapter (line 1632) | class CuteGPTAdapter(BaseModelAdapter): method match (line 1635) | def match(self, model_path: str): method load_model (line 1638) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 1648) | def get_default_conv_template(self, model_path: str) -> Conversation: class OpenOrcaAdapter (line 1652) | class OpenOrcaAdapter(BaseModelAdapter): method match (line 1664) | def match(self, model_path: str): method load_model (line 1670) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 1682) | def get_default_conv_template(self, model_path: str) -> Conversation: class DolphinAdapter (line 1688) | class DolphinAdapter(OpenOrcaAdapter): method match (line 1691) | def match(self, model_path: str): method get_default_conv_template (line 1694) | def get_default_conv_template(self, model_path: str) -> Conversation: class Hermes2Adapter (line 1698) | class Hermes2Adapter(BaseModelAdapter): method match (line 1703) | def match(self, model_path: str): method load_model (line 1709) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 1721) | def get_default_conv_template(self, model_path: str) -> Conversation: class NousHermes2MixtralAdapter (line 1725) | class NousHermes2MixtralAdapter(BaseModelAdapter): method match (line 1728) | def match(self, model_path: str): method get_default_conv_template (line 1737) | def get_default_conv_template(self, model_path: str) -> Conversation: class WizardCoderAdapter (line 1741) | class WizardCoderAdapter(BaseModelAdapter): method match (line 1746) | def match(self, model_path: str): method get_default_conv_template (line 1749) | def get_default_conv_template(self, model_path: str) -> Conversation: class QwenChatAdapter (line 1755) | class QwenChatAdapter(BaseModelAdapter): method match (line 1773) | def match(self, model_path: str): method float_set (line 1776) | def float_set(self, config, option): method load_model (line 1790) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 1825) | def get_default_conv_template(self, model_path: str) -> Conversation: class SmaugChatAdapter (line 1829) | class SmaugChatAdapter(BaseModelAdapter): method match (line 1832) | def match(self, model_path: str): method get_default_conv_template (line 1835) | def get_default_conv_template(self, model_path: str) -> Conversation: class BGEAdapter (line 1839) | class BGEAdapter(BaseModelAdapter): method match (line 1844) | def match(self, model_path: str): method load_model (line 1847) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 1866) | def get_default_conv_template(self, model_path: str) -> Conversation: class E5Adapter (line 1870) | class E5Adapter(BaseModelAdapter): method match (line 1875) | def match(self, model_path: str): method load_model (line 1878) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 1895) | def get_default_conv_template(self, model_path: str) -> Conversation: class AquilaChatAdapter (line 1899) | class AquilaChatAdapter(BaseModelAdapter): method match (line 1908) | def match(self, model_path: str): method load_model (line 1911) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 1925) | def get_default_conv_template(self, model_path: str) -> Conversation: class Lamma2ChineseAdapter (line 1939) | class Lamma2ChineseAdapter(BaseModelAdapter): method match (line 1942) | def match(self, model_path: str): method load_model (line 1945) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 1960) | def get_default_conv_template(self, model_path: str) -> Conversation: class Lamma2ChineseAlpacaAdapter (line 1964) | class Lamma2ChineseAlpacaAdapter(BaseModelAdapter): method match (line 1967) | def match(self, model_path: str): method load_model (line 1970) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 1985) | def get_default_conv_template(self, model_path: str) -> Conversation: class VigogneAdapter (line 1989) | class VigogneAdapter(BaseModelAdapter): method match (line 1994) | def match(self, model_path: str): method load_model (line 1997) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 2013) | def get_default_conv_template(self, model_path: str) -> Conversation: class OpenLLaMaOpenInstructAdapter (line 2021) | class OpenLLaMaOpenInstructAdapter(BaseModelAdapter): method match (line 2026) | def match(self, model_path: str): method load_model (line 2031) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 2047) | def get_default_conv_template(self, model_path: str) -> Conversation: class CodeLlamaAdapter (line 2051) | class CodeLlamaAdapter(BaseModelAdapter): method match (line 2054) | def match(self, model_path: str): method load_model (line 2057) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 2063) | def get_default_conv_template(self, model_path: str) -> Conversation: class StableVicunaAdapter (line 2067) | class StableVicunaAdapter(BaseModelAdapter): method match (line 2070) | def match(self, model_path: str): method load_model (line 2073) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 2079) | def get_default_conv_template(self, model_path: str) -> Conversation: class PhindCodeLlamaAdapter (line 2083) | class PhindCodeLlamaAdapter(CodeLlamaAdapter): method match (line 2086) | def match(self, model_path: str): method get_default_conv_template (line 2089) | def get_default_conv_template(self, model_path: str) -> Conversation: class Llama2ChangAdapter (line 2093) | class Llama2ChangAdapter(Llama2Adapter): method match (line 2096) | def match(self, model_path: str): method get_default_conv_template (line 2099) | def get_default_conv_template(self, model_path: str) -> Conversation: class ZephyrAdapter (line 2103) | class ZephyrAdapter(BaseModelAdapter): method match (line 2106) | def match(self, model_path: str): method get_default_conv_template (line 2109) | def get_default_conv_template(self, model_path: str) -> Conversation: class NotusAdapter (line 2113) | class NotusAdapter(BaseModelAdapter): method match (line 2116) | def match(self, model_path: str): method get_default_conv_template (line 2119) | def get_default_conv_template(self, model_path: str) -> Conversation: class CatPPTAdapter (line 2123) | class CatPPTAdapter(BaseModelAdapter): method match (line 2126) | def match(self, model_path: str): method get_default_conv_template (line 2129) | def get_default_conv_template(self, model_path: str) -> Conversation: class TinyLlamaAdapter (line 2133) | class TinyLlamaAdapter(BaseModelAdapter): method match (line 2136) | def match(self, model_path: str): method get_default_conv_template (line 2139) | def get_default_conv_template(self, model_path: str) -> Conversation: class XwinLMAdapter (line 2143) | class XwinLMAdapter(BaseModelAdapter): method match (line 2148) | def match(self, model_path: str): method get_default_conv_template (line 2151) | def get_default_conv_template(self, model_path: str) -> Conversation: class LemurAdapter (line 2155) | class LemurAdapter(BaseModelAdapter): method match (line 2160) | def match(self, model_path: str): method get_default_conv_template (line 2163) | def get_default_conv_template(self, model_path: str) -> Conversation: class PygmalionAdapter (line 2167) | class PygmalionAdapter(BaseModelAdapter): method match (line 2172) | def match(self, model_path: str): method get_default_conv_template (line 2177) | def get_default_conv_template(self, model_path: str) -> Conversation: class XdanAdapter (line 2181) | class XdanAdapter(BaseModelAdapter): method match (line 2184) | def match(self, model_path: str): method get_default_conv_template (line 2187) | def get_default_conv_template(self, model_path: str) -> Conversation: class MicrosoftOrcaAdapter (line 2191) | class MicrosoftOrcaAdapter(BaseModelAdapter): method match (line 2196) | def match(self, model_path: str): method get_default_conv_template (line 2199) | def get_default_conv_template(self, model_path: str) -> Conversation: class YiAdapter (line 2203) | class YiAdapter(BaseModelAdapter): method match (line 2206) | def match(self, model_path: str): method get_default_conv_template (line 2209) | def get_default_conv_template(self, model_path: str) -> Conversation: class DeepseekCoderAdapter (line 2213) | class DeepseekCoderAdapter(BaseModelAdapter): method match (line 2216) | def match(self, model_path: str): method get_default_conv_template (line 2219) | def get_default_conv_template(self, model_path: str) -> Conversation: class DeepseekChatAdapter (line 2223) | class DeepseekChatAdapter(BaseModelAdapter): method match (line 2228) | def match(self, model_path: str): method get_default_conv_template (line 2231) | def get_default_conv_template(self, model_path: str) -> Conversation: class GeminiAdapter (line 2235) | class GeminiAdapter(BaseModelAdapter): method match (line 1223) | def match(self, model_path: str): method load_model (line 1226) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 1229) | def get_default_conv_template(self, model_path: str) -> Conversation: method match (line 2238) | def match(self, model_path: str): method load_model (line 2241) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 2244) | def get_default_conv_template(self, model_path: str) -> Conversation: class Yuan2Adapter (line 2250) | class Yuan2Adapter(BaseModelAdapter): method match (line 2253) | def match(self, model_path: str): method load_model (line 2256) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 2297) | def get_default_conv_template(self, model_path: str) -> Conversation: class MetaMathAdapter (line 2301) | class MetaMathAdapter(BaseModelAdapter): method match (line 2304) | def match(self, model_path: str): method get_default_conv_template (line 2307) | def get_default_conv_template(self, model_path: str) -> Conversation: class BagelAdapter (line 2311) | class BagelAdapter(BaseModelAdapter): method match (line 2314) | def match(self, model_path: str): method get_default_conv_template (line 2317) | def get_default_conv_template(self, model_path: str) -> Conversation: class SolarAdapter (line 2321) | class SolarAdapter(BaseModelAdapter): method match (line 2324) | def match(self, model_path: str): method get_default_conv_template (line 2327) | def get_default_conv_template(self, model_path: str) -> Conversation: class SteerLMAdapter (line 2331) | class SteerLMAdapter(BaseModelAdapter): method match (line 2334) | def match(self, model_path: str): method get_default_conv_template (line 2337) | def get_default_conv_template(self, model_path: str) -> Conversation: class GemmaAdapter (line 2341) | class GemmaAdapter(BaseModelAdapter): method match (line 2344) | def match(self, model_path: str): method get_default_conv_template (line 2347) | def get_default_conv_template(self, model_path: str) -> Conversation: class LlavaAdapter (line 2351) | class LlavaAdapter(BaseModelAdapter): method load_model (line 2354) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method match (line 2358) | def match(self, model_path: str): method get_default_conv_template (line 2361) | def get_default_conv_template(self, model_path: str) -> Conversation: class YuanAdapter (line 2369) | class YuanAdapter(BaseModelAdapter): method match (line 2372) | def match(self, model_path: str): method load_model (line 2375) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 2399) | def get_default_conv_template(self, model_path: str) -> Conversation: class OlmoAdapter (line 2403) | class OlmoAdapter(BaseModelAdapter): method match (line 2406) | def match(self, model_path: str): method get_default_conv_template (line 2409) | def get_default_conv_template(self, model_path: str) -> Conversation: class YandexGPTAdapter (line 2413) | class YandexGPTAdapter(BaseModelAdapter): method match (line 2416) | def match(self, model_path: str): method get_default_conv_template (line 2419) | def get_default_conv_template(self, model_path: str) -> Conversation: class CllmAdapter (line 2423) | class CllmAdapter(BaseModelAdapter): method match (line 2426) | def match(self, model_path: str): method load_model (line 2429) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 2450) | def get_default_conv_template(self, model_path: str) -> Conversation: class CohereAdapter (line 2454) | class CohereAdapter(BaseModelAdapter): method match (line 2457) | def match(self, model_path: str): method load_model (line 2460) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 2463) | def get_default_conv_template(self, model_path: str) -> Conversation: class DBRXAdapter (line 2467) | class DBRXAdapter(BaseModelAdapter): method match (line 2470) | def match(self, model_path: str): method load_model (line 2473) | def load_model(self, model_path: str, from_pretrained_kwargs: dict): method get_default_conv_template (line 2476) | def get_default_conv_template(self, model_path: str) -> Conversation: class RekaAdapter (line 2480) | class RekaAdapter(BaseModelAdapter): method match (line 2483) | def match(self, model_path: str): method get_default_conv_template (line 2486) | def get_default_conv_template(self, model_path: str) -> Conversation: class NoSystemAdapter (line 2490) | class NoSystemAdapter(BaseModelAdapter): method match (line 2491) | def match(self, model_path: str): method get_default_conv_template (line 2499) | def get_default_conv_template(self, model_path: str) -> Conversation: FILE: fastchat/model/model_chatglm.py class InvalidScoreLogitsProcessor (line 11) | class InvalidScoreLogitsProcessor(LogitsProcessor): method __call__ (line 12) | def __call__( function process_response (line 24) | def process_response(response): function recover_message_list (line 40) | def recover_message_list(prompt): function generate_stream_chatglm (line 66) | def generate_stream_chatglm( FILE: fastchat/model/model_cllm.py function get_jacobian_trajectory (line 21) | def get_jacobian_trajectory( function generate_stream_cllm (line 109) | def generate_stream_cllm( FILE: fastchat/model/model_codet5p.py function generate_stream_codet5p (line 14) | def generate_stream_codet5p( FILE: fastchat/model/model_exllama.py function generate_stream_exllama (line 8) | def generate_stream_exllama( FILE: fastchat/model/model_falcon.py function generate_stream_falcon (line 13) | def generate_stream_falcon( FILE: fastchat/model/model_registry.py function register_model_info (line 12) | def register_model_info( function get_model_info (line 21) | def get_model_info(name: str) -> ModelInfo: FILE: fastchat/model/model_xfastertransformer.py function generate_stream_xft (line 9) | def generate_stream_xft( FILE: fastchat/model/model_yuan2.py function generate_stream_yuan2 (line 13) | def generate_stream_yuan2( FILE: fastchat/model/monkey_patch_non_inplace.py function rotate_half (line 13) | def rotate_half(x): function apply_rotary_pos_emb (line 20) | def apply_rotary_pos_emb(q, k, cos, sin, position_ids): function forward (line 30) | def forward( function replace_llama_attn_with_non_inplace_operations (line 117) | def replace_llama_attn_with_non_inplace_operations(): FILE: fastchat/model/rwkv_model.py class RwkvModel (line 14) | class RwkvModel: method __init__ (line 15) | def __init__(self, model_path): method to (line 27) | def to(self, target): method __call__ (line 30) | def __call__(self, input_ids, use_cache, past_key_values=None): method generate (line 40) | def generate( FILE: fastchat/model/upload_hub.py function upload_hub (line 14) | def upload_hub(model_path, hub_repo_id, component, private): FILE: fastchat/modules/awq.py class AWQConfig (line 10) | class AWQConfig: function load_awq_quantized (line 24) | def load_awq_quantized(model_name, awq_config: AWQConfig, device): function find_awq_ckpt (line 75) | def find_awq_ckpt(awq_config: AWQConfig): FILE: fastchat/modules/exllama.py class ExllamaConfig (line 6) | class ExllamaConfig: class ExllamaModel (line 12) | class ExllamaModel: method __init__ (line 13) | def __init__(self, exllama_model, exllama_cache): function load_exllama_model (line 19) | def load_exllama_model(model_path, exllama_config: ExllamaConfig): FILE: fastchat/modules/gptq.py class GptqConfig (line 11) | class GptqConfig: function load_gptq_quantized (line 29) | def load_gptq_quantized(model_name, gptq_config: GptqConfig): function find_gptq_ckpt (line 65) | def find_gptq_ckpt(gptq_config: GptqConfig): FILE: fastchat/modules/xfastertransformer.py class XftConfig (line 6) | class XftConfig: class XftModel (line 18) | class XftModel: method __init__ (line 19) | def __init__(self, xft_model, xft_config): function load_xft_model (line 24) | def load_xft_model(model_path, xft_config: XftConfig): FILE: fastchat/protocol/api_protocol.py class ErrorResponse (line 9) | class ErrorResponse(BaseModel): class ModelPermission (line 15) | class ModelPermission(BaseModel): class ModelCard (line 30) | class ModelCard(BaseModel): class ModelList (line 40) | class ModelList(BaseModel): class UsageInfo (line 45) | class UsageInfo(BaseModel): class APIChatCompletionRequest (line 51) | class APIChatCompletionRequest(BaseModel): class ChatMessage (line 67) | class ChatMessage(BaseModel): class ChatCompletionResponseChoice (line 72) | class ChatCompletionResponseChoice(BaseModel): class ChatCompletionResponse (line 78) | class ChatCompletionResponse(BaseModel): class DeltaMessage (line 87) | class DeltaMessage(BaseModel): class ChatCompletionResponseStreamChoice (line 92) | class ChatCompletionResponseStreamChoice(BaseModel): class ChatCompletionStreamResponse (line 98) | class ChatCompletionStreamResponse(BaseModel): class APITokenCheckRequestItem (line 106) | class APITokenCheckRequestItem(BaseModel): class APITokenCheckRequest (line 112) | class APITokenCheckRequest(BaseModel): class APITokenCheckResponseItem (line 116) | class APITokenCheckResponseItem(BaseModel): class APITokenCheckResponse (line 122) | class APITokenCheckResponse(BaseModel): class CompletionRequest (line 126) | class CompletionRequest(BaseModel): class CompletionResponseChoice (line 144) | class CompletionResponseChoice(BaseModel): class CompletionResponse (line 151) | class CompletionResponse(BaseModel): class CompletionResponseStreamChoice (line 160) | class CompletionResponseStreamChoice(BaseModel): class CompletionStreamResponse (line 167) | class CompletionStreamResponse(BaseModel): FILE: fastchat/protocol/openai_api_protocol.py class ErrorResponse (line 9) | class ErrorResponse(BaseModel): class ModelPermission (line 15) | class ModelPermission(BaseModel): class ModelCard (line 30) | class ModelCard(BaseModel): class ModelList (line 40) | class ModelList(BaseModel): class UsageInfo (line 45) | class UsageInfo(BaseModel): class LogProbs (line 51) | class LogProbs(BaseModel): class ChatCompletionRequest (line 58) | class ChatCompletionRequest(BaseModel): class ChatMessage (line 77) | class ChatMessage(BaseModel): class ChatCompletionResponseChoice (line 82) | class ChatCompletionResponseChoice(BaseModel): class ChatCompletionResponse (line 88) | class ChatCompletionResponse(BaseModel): class DeltaMessage (line 97) | class DeltaMessage(BaseModel): class ChatCompletionResponseStreamChoice (line 102) | class ChatCompletionResponseStreamChoice(BaseModel): class ChatCompletionStreamResponse (line 108) | class ChatCompletionStreamResponse(BaseModel): class TokenCheckRequestItem (line 116) | class TokenCheckRequestItem(BaseModel): class TokenCheckRequest (line 122) | class TokenCheckRequest(BaseModel): class TokenCheckResponseItem (line 126) | class TokenCheckResponseItem(BaseModel): class TokenCheckResponse (line 132) | class TokenCheckResponse(BaseModel): class EmbeddingsRequest (line 136) | class EmbeddingsRequest(BaseModel): class EmbeddingsResponse (line 144) | class EmbeddingsResponse(BaseModel): class CompletionRequest (line 151) | class CompletionRequest(BaseModel): class CompletionResponseChoice (line 171) | class CompletionResponseChoice(BaseModel): class CompletionResponse (line 178) | class CompletionResponse(BaseModel): class CompletionResponseStreamChoice (line 187) | class CompletionResponseStreamChoice(BaseModel): class CompletionStreamResponse (line 194) | class CompletionStreamResponse(BaseModel): FILE: fastchat/serve/api_provider.py function get_api_provider_stream_iter (line 18) | def get_api_provider_stream_iter( function openai_api_stream_iter (line 268) | def openai_api_stream_iter( function column_api_stream_iter (line 364) | def column_api_stream_iter( function p2l_api_stream_iter (line 428) | def p2l_api_stream_iter( function upload_openai_file_to_gcs (line 496) | def upload_openai_file_to_gcs(file_id): function openai_assistant_api_stream_iter (line 511) | def openai_assistant_api_stream_iter( function anthropic_api_stream_iter (line 651) | def anthropic_api_stream_iter(model_name, prompt, temperature, top_p, ma... function anthropic_message_api_stream_iter (line 685) | def anthropic_message_api_stream_iter( function gemini_api_stream_iter (line 756) | def gemini_api_stream_iter( function ai2_api_stream_iter (line 846) | def ai2_api_stream_iter( function mistral_api_stream_iter (line 919) | def mistral_api_stream_iter( function nvidia_api_stream_iter (line 978) | def nvidia_api_stream_iter( function yandexgpt_api_stream_iter (line 1036) | def yandexgpt_api_stream_iter( function cohere_api_stream_iter (line 1077) | def cohere_api_stream_iter( function vertex_api_stream_iter (line 1146) | def vertex_api_stream_iter(model_name, messages, temperature, top_p, max... function reka_api_stream_iter (line 1212) | def reka_api_stream_iter( function metagen_api_stream_iter (line 1272) | def metagen_api_stream_iter( FILE: fastchat/serve/base_model_worker.py function heart_beat_worker (line 21) | def heart_beat_worker(obj): class BaseModelWorker (line 27) | class BaseModelWorker: method __init__ (line 28) | def __init__( method make_conv_template (line 63) | def make_conv_template( method init_heart_beat (line 80) | def init_heart_beat(self): method register_to_controller (line 89) | def register_to_controller(self): method send_heart_beat (line 102) | def send_heart_beat(self): method get_queue_length (line 131) | def get_queue_length(self): method get_status (line 145) | def get_status(self): method count_token (line 152) | def count_token(self, params): method get_conv_template (line 167) | def get_conv_template(self): method generate_stream_gate (line 170) | def generate_stream_gate(self, params): method generate_gate (line 173) | def generate_gate(self, params): method get_embeddings (line 176) | def get_embeddings(self, params): function release_worker_semaphore (line 180) | def release_worker_semaphore(): function acquire_worker_semaphore (line 184) | def acquire_worker_semaphore(): function create_background_tasks (line 190) | def create_background_tasks(): function api_generate_stream (line 197) | async def api_generate_stream(request: Request): function api_generate (line 206) | async def api_generate(request: Request): function api_get_embeddings (line 215) | async def api_get_embeddings(request: Request): function api_get_status (line 224) | async def api_get_status(request: Request): function api_count_token (line 229) | async def api_count_token(request: Request): function api_get_conv (line 235) | async def api_get_conv(request: Request): function api_model_details (line 240) | async def api_model_details(request: Request): FILE: fastchat/serve/call_monitor.py class Monitor (line 15) | class Monitor: method __init__ (line 18) | def __init__(self, log_dir_list: list): method update_stats (line 25) | async def update_stats(self, num_file=1) -> None: method get_model_call_limit (line 68) | def get_model_call_limit(self, model: str) -> int: method update_model_call_limit (line 73) | def update_model_call_limit(self, model: str, limit: int) -> bool: method is_model_limit_reached (line 79) | def is_model_limit_reached(self, model: str) -> bool: method is_user_limit_reached (line 89) | def is_user_limit_reached(self, model: str, user_id: str) -> bool: method get_model_call_stats (line 104) | def get_model_call_stats( method get_user_call_stats (line 124) | def get_user_call_stats( method get_num_users (line 153) | def get_num_users(self, most_recent_min: int = 60) -> int: function app_startup (line 165) | async def app_startup(): function get_model_call_limit (line 170) | async def get_model_call_limit(model: str): function update_model_call_limit (line 175) | async def update_model_call_limit(model: str, limit: int): function is_limit_reached (line 182) | async def is_limit_reached(model: str, user_id: str): function get_num_users (line 197) | async def get_num_users(): function get_num_users_day (line 202) | async def get_num_users_day(): function get_user_call_stats (line 207) | async def get_user_call_stats( function get_model_call_stats (line 216) | async def get_model_call_stats( FILE: fastchat/serve/cli.py class SimpleChatIO (line 40) | class SimpleChatIO(ChatIO): method __init__ (line 41) | def __init__(self, multiline: bool = False): method prompt_for_input (line 44) | def prompt_for_input(self, role) -> str: method prompt_for_output (line 58) | def prompt_for_output(self, role: str): method stream_output (line 61) | def stream_output(self, output_stream): method print_output (line 73) | def print_output(self, text: str): class RichChatIO (line 77) | class RichChatIO(ChatIO): method _ (line 81) | def _(event): method __init__ (line 84) | def __init__(self, multiline: bool = False, mouse: bool = False): method prompt_for_input (line 94) | def prompt_for_input(self, role) -> str: method prompt_for_output (line 107) | def prompt_for_output(self, role: str): method stream_output (line 110) | def stream_output(self, output_stream): method print_output (line 148) | def print_output(self, text: str): class ProgrammaticChatIO (line 152) | class ProgrammaticChatIO(ChatIO): method prompt_for_input (line 153) | def prompt_for_input(self, role) -> str: method prompt_for_output (line 173) | def prompt_for_output(self, role: str): method stream_output (line 176) | def stream_output(self, output_stream): method print_output (line 188) | def print_output(self, text: str): function main (line 192) | def main(args): FILE: fastchat/serve/controller.py class DispatchMethod (line 34) | class DispatchMethod(Enum): method from_str (line 39) | def from_str(cls, name): class WorkerInfo (line 49) | class WorkerInfo: function heart_beat_controller (line 58) | def heart_beat_controller(controller): class Controller (line 64) | class Controller: method __init__ (line 65) | def __init__(self, dispatch_method: str): method register_worker (line 75) | def register_worker( method get_worker_status (line 104) | def get_worker_status(self, worker_name: str): method remove_worker (line 117) | def remove_worker(self, worker_name: str): method refresh_all_workers (line 120) | def refresh_all_workers(self): method list_models (line 130) | def list_models(self): method list_multimodal_models (line 138) | def list_multimodal_models(self): method list_language_models (line 147) | def list_language_models(self): method get_worker_address (line 156) | def get_worker_address(self, model_name: str): method receive_heart_beat (line 209) | def receive_heart_beat(self, worker_name: str, queue_length: int): method remove_stale_workers_by_expiration (line 219) | def remove_stale_workers_by_expiration(self): method handle_no_worker (line 229) | def handle_no_worker(self, params): method handle_worker_timeout (line 237) | def handle_worker_timeout(self, worker_address): method worker_api_get_status (line 247) | def worker_api_get_status(self): method worker_api_generate_stream (line 266) | def worker_api_generate_stream(self, params): function register_worker (line 289) | async def register_worker(request: Request): function refresh_all_workers (line 300) | async def refresh_all_workers(): function list_models (line 305) | async def list_models(): function list_multimodal_models (line 311) | async def list_multimodal_models(): function list_language_models (line 317) | async def list_language_models(): function get_worker_address (line 323) | async def get_worker_address(request: Request): function receive_heart_beat (line 330) | async def receive_heart_beat(request: Request): function worker_api_generate_stream (line 337) | async def worker_api_generate_stream(request: Request): function worker_api_get_status (line 344) | async def worker_api_get_status(request: Request): function worker_api_get_status (line 349) | async def worker_api_get_status(request: Request): function create_controller (line 353) | def create_controller(): FILE: fastchat/serve/dashinfer_worker.py function download_model (line 32) | def download_model(model_id, revision): class DashInferWorker (line 54) | class DashInferWorker(BaseModelWorker): method __init__ (line 55) | def __init__( method generate_stream (line 96) | async def generate_stream(self, params): method generate (line 208) | async def generate(self, params): function release_worker_semaphore (line 214) | def release_worker_semaphore(): function acquire_worker_semaphore (line 218) | def acquire_worker_semaphore(): function create_background_tasks (line 224) | def create_background_tasks(): function api_generate_stream (line 231) | async def api_generate_stream(request: Request): function api_generate (line 240) | async def api_generate(request: Request): function api_get_status (line 249) | async def api_get_status(request: Request): function api_count_token (line 254) | async def api_count_token(request: Request): function api_get_conv (line 260) | async def api_get_conv(request: Request): function api_model_details (line 265) | async def api_model_details(request: Request): FILE: fastchat/serve/gradio_block_arena_anony.py function set_global_vars_anony (line 51) | def set_global_vars_anony(enable_moderation_): function load_demo_side_by_side_anony (line 56) | def load_demo_side_by_side_anony(models_, url_params): function vote_last_response (line 69) | def vote_last_response(states, vote_type, model_selectors, request: gr.R... function leftvote_last_response (line 102) | def leftvote_last_response( function rightvote_last_response (line 112) | def rightvote_last_response( function tievote_last_response (line 122) | def tievote_last_response( function bothbad_vote_last_response (line 132) | def bothbad_vote_last_response( function regenerate (line 142) | def regenerate(state0, state1, request: gr.Request): function clear_history (line 156) | def clear_history(request: gr.Request): function share_click (line 170) | def share_click(state0, state1, model_selector0, model_selector1, reques... function get_sample_weight (line 193) | def get_sample_weight(model, outage_models, sampling_weights, sampling_b... function is_model_match_pattern (line 202) | def is_model_match_pattern(model, patterns): function get_battle_pair (line 212) | def get_battle_pair( function add_text (line 269) | def add_text( function bot_response_multi (line 358) | def bot_response_multi( function build_side_by_side_ui_anony (line 441) | def build_side_by_side_ui_anony(models): FILE: fastchat/serve/gradio_block_arena_named.py function set_global_vars_named (line 44) | def set_global_vars_named(enable_moderation_): function load_demo_side_by_side_named (line 49) | def load_demo_side_by_side_named(models, url_params): function vote_last_response (line 68) | def vote_last_response(states, vote_type, model_selectors, request: gr.R... function leftvote_last_response (line 81) | def leftvote_last_response( function rightvote_last_response (line 91) | def rightvote_last_response( function tievote_last_response (line 101) | def tievote_last_response( function bothbad_vote_last_response (line 111) | def bothbad_vote_last_response( function regenerate (line 121) | def regenerate(state0, state1, request: gr.Request): function clear_history (line 135) | def clear_history(request: gr.Request): function share_click (line 146) | def share_click(state0, state1, model_selector0, model_selector1, reques... function add_text (line 154) | def add_text( function bot_response_multi (line 224) | def bot_response_multi( function flash_buttons (line 304) | def flash_buttons(): function build_side_by_side_ui_named (line 314) | def build_side_by_side_ui_named(models): FILE: fastchat/serve/gradio_block_arena_vision.py function get_vqa_sample (line 70) | def get_vqa_sample(): function set_visible_image (line 77) | def set_visible_image(textbox): function set_invisible_image (line 89) | def set_invisible_image(): function add_image (line 93) | def add_image(textbox): function vote_last_response (line 101) | def vote_last_response(state, vote_type, model_selector, request: gr.Req... function upvote_last_response (line 115) | def upvote_last_response(state, model_selector, request: gr.Request): function downvote_last_response (line 122) | def downvote_last_response(state, model_selector, request: gr.Request): function flag_last_response (line 129) | def flag_last_response(state, model_selector, request: gr.Request): function regenerate (line 136) | def regenerate(state, request: gr.Request): function clear_history (line 146) | def clear_history(request: gr.Request): function clear_history_example (line 155) | def clear_history_example(request: gr.Request): function report_csam_image (line 165) | def report_csam_image(state, image): function _prepare_text_with_image (line 169) | def _prepare_text_with_image(state, text, images, csam_flag): function convert_images_to_conversation_format (line 181) | def convert_images_to_conversation_format(images): function moderate_input (line 194) | def moderate_input(state, text, all_conv_text, model_list, images, ip): function add_text (line 219) | def add_text( function build_single_vision_language_model_ui (line 298) | def build_single_vision_language_model_ui( FILE: fastchat/serve/gradio_block_arena_vision_anony.py function get_vqa_sample (line 100) | def get_vqa_sample(): function load_demo_side_by_side_vision_anony (line 107) | def load_demo_side_by_side_vision_anony(): function clear_history_example (line 117) | def clear_history_example(request: gr.Request): function vote_last_response (line 130) | def vote_last_response(states, vote_type, model_selectors, request: gr.R... function leftvote_last_response (line 173) | def leftvote_last_response( function rightvote_last_response (line 183) | def rightvote_last_response( function tievote_last_response (line 193) | def tievote_last_response( function bothbad_vote_last_response (line 203) | def bothbad_vote_last_response( function regenerate (line 213) | def regenerate(state0, state1, request: gr.Request): function clear_history (line 232) | def clear_history(request: gr.Request): function add_text (line 246) | def add_text( function build_side_by_side_vision_ui_anony (line 378) | def build_side_by_side_vision_ui_anony(context: Context, random_question... FILE: fastchat/serve/gradio_block_arena_vision_named.py function load_demo_side_by_side_vision_named (line 72) | def load_demo_side_by_side_vision_named(context: Context): function clear_history_example (line 95) | def clear_history_example(request: gr.Request): function vote_last_response (line 106) | def vote_last_response(states, vote_type, model_selectors, request: gr.R... function leftvote_last_response (line 120) | def leftvote_last_response( function rightvote_last_response (line 130) | def rightvote_last_response( function tievote_last_response (line 140) | def tievote_last_response( function bothbad_vote_last_response (line 150) | def bothbad_vote_last_response( function regenerate (line 160) | def regenerate(state0, state1, request: gr.Request): function clear_history (line 179) | def clear_history(request: gr.Request): function add_text (line 190) | def add_text( function build_side_by_side_vision_ui_named (line 305) | def build_side_by_side_vision_ui_named(context: Context, random_question... FILE: fastchat/serve/gradio_global_state.py class Context (line 6) | class Context: FILE: fastchat/serve/gradio_web_server.py class State (line 114) | class State: method __init__ (line 115) | def __init__(self, model_name, is_vision=False): method update_ans_models (line 133) | def update_ans_models(self, ans: str) -> None: method update_router_outputs (line 136) | def update_router_outputs(self, outputs: Dict[str, float]) -> None: method init_system_prompt (line 139) | def init_system_prompt(self, conv, is_vision): method to_gradio_chatbot (line 153) | def to_gradio_chatbot(self): method dict (line 156) | def dict(self): function set_global_vars (line 184) | def set_global_vars( function get_conv_log_filename (line 195) | def get_conv_log_filename(is_vision=False, has_csam_image=False): function get_model_list (line 208) | def get_model_list(controller_url, register_api_endpoint_file, vision_ar... function load_demo_single (line 255) | def load_demo_single(context: Context, query_params): function load_demo (line 274) | def load_demo(url_params, request: gr.Request): function vote_last_response (line 288) | def vote_last_response(state, vote_type, model_selector, request: gr.Req... function upvote_last_response (line 305) | def upvote_last_response(state, model_selector, request: gr.Request): function downvote_last_response (line 312) | def downvote_last_response(state, model_selector, request: gr.Request): function flag_last_response (line 319) | def flag_last_response(state, model_selector, request: gr.Request): function regenerate (line 326) | def regenerate(state, request: gr.Request): function clear_history (line 336) | def clear_history(request: gr.Request): function get_ip (line 343) | def get_ip(request: gr.Request): function add_text (line 355) | def add_text(state, model_selector, text, request: gr.Request): function model_worker_stream_iter (line 388) | def model_worker_stream_iter( function is_limit_reached (line 431) | def is_limit_reached(model_name, ip): function bot_response (line 444) | def bot_response( function get_model_description_md (line 826) | def get_model_description_md(models): function build_about (line 849) | def build_about(): function build_single_model_ui (line 887) | def build_single_model_ui(models, add_promotion_links=False): function build_demo (line 1029) | def build_demo(models): FILE: fastchat/serve/gradio_web_server_multi.py function build_visualizer (line 53) | def build_visualizer(): function load_demo (line 110) | def load_demo(context: Context, request: gr.Request): function build_demo (line 169) | def build_demo( FILE: fastchat/serve/huggingface_api.py function main (line 16) | def main(args): FILE: fastchat/serve/huggingface_api_worker.py function get_gen_kwargs (line 51) | def get_gen_kwargs( function could_be_stop (line 83) | def could_be_stop(text, stop): class HuggingfaceApiWorker (line 90) | class HuggingfaceApiWorker(BaseModelWorker): method __init__ (line 91) | def __init__( method count_token (line 130) | def count_token(self, params): method generate_stream_gate (line 138) | def generate_stream_gate(self, params): method generate_gate (line 196) | def generate_gate(self, params): method get_embeddings (line 201) | def get_embeddings(self, params): function release_worker_semaphore (line 205) | def release_worker_semaphore(worker): function acquire_worker_semaphore (line 209) | def acquire_worker_semaphore(worker): function create_background_tasks (line 215) | def create_background_tasks(worker): function api_generate_stream (line 222) | async def api_generate_stream(request: Request): function api_generate (line 232) | async def api_generate(request: Request): function api_get_embeddings (line 242) | async def api_get_embeddings(request: Request): function api_get_status (line 252) | async def api_get_status(request: Request): function api_count_token (line 261) | async def api_count_token(request: Request): function api_get_conv (line 268) | async def api_get_conv(request: Request): function api_model_details (line 275) | async def api_model_details(request: Request): function create_huggingface_api_worker (line 281) | def create_huggingface_api_worker(): FILE: fastchat/serve/inference.py function prepare_logits_processor (line 45) | def prepare_logits_processor( function generate_stream (line 62) | def generate_stream( class ChatIO (line 319) | class ChatIO(abc.ABC): method prompt_for_input (line 321) | def prompt_for_input(self, role: str) -> str: method prompt_for_output (line 325) | def prompt_for_output(self, role: str): method stream_output (line 329) | def stream_output(self, output_stream): method print_output (line 333) | def print_output(self, text: str): function chat_loop (line 337) | def chat_loop( FILE: fastchat/serve/launch_all_serve.py function string_args (line 209) | def string_args(args, args_list): function launch_worker (line 235) | def launch_worker(item): function launch_all (line 256) | def launch_all(): FILE: fastchat/serve/lightllm_worker.py class LightLLMWorker (line 42) | class LightLLMWorker(BaseModelWorker): method __init__ (line 43) | def __init__( method generate_stream (line 77) | async def generate_stream(self, params): method generate (line 188) | async def generate(self, params): function release_worker_semaphore (line 194) | def release_worker_semaphore(): function acquire_worker_semaphore (line 198) | def acquire_worker_semaphore(): function create_background_tasks (line 204) | def create_background_tasks(request_id): function api_generate_stream (line 215) | async def api_generate_stream(request: Request): function api_generate (line 227) | async def api_generate(request: Request): function api_get_status (line 240) | async def api_get_status(request: Request): function api_count_token (line 245) | async def api_count_token(request: Request): function api_get_conv (line 251) | async def api_get_conv(request: Request): function api_model_details (line 256) | async def api_model_details(request: Request): FILE: fastchat/serve/mlx_worker.py class MLXWorker (line 39) | class MLXWorker(BaseModelWorker): method __init__ (line 40) | def __init__( method generate_stream (line 77) | async def generate_stream(self, params): method generate (line 165) | async def generate(self, params): function release_worker_semaphore (line 171) | def release_worker_semaphore(): function acquire_worker_semaphore (line 175) | def acquire_worker_semaphore(): function create_background_tasks (line 181) | def create_background_tasks(request_id): function api_generate_stream (line 192) | async def api_generate_stream(request: Request): function api_generate (line 203) | async def api_generate(request: Request): function api_get_status (line 216) | async def api_get_status(request: Request): function api_count_token (line 221) | async def api_count_token(request: Request): function api_get_conv (line 227) | async def api_get_conv(request: Request): function api_model_details (line 232) | async def api_model_details(request: Request): function cleanup_at_exit (line 239) | def cleanup_at_exit(): FILE: fastchat/serve/model_worker.py class ModelWorker (line 38) | class ModelWorker(BaseModelWorker): method __init__ (line 39) | def __init__( method generate_stream_gate (line 104) | def generate_stream_gate(self, params): method generate_gate (line 146) | def generate_gate(self, params): method __process_embed_chunk (line 151) | def __process_embed_chunk(self, input_ids, attention_mask, **model_typ... method __encode_base64 (line 178) | def __encode_base64(self, embeddings: torch.Tensor) -> List[str]: method get_embeddings (line 185) | def get_embeddings(self, params): function create_model_worker (line 303) | def create_model_worker(): FILE: fastchat/serve/monitor/add_markdown_info.py function count_markdown_elements (line 10) | def count_markdown_elements(markdown_text, suffix): function remove_pattern (line 32) | def remove_pattern(answer, pattern): function get_element_counts (line 39) | def get_element_counts(df, column): function add_markdown_meta (line 56) | def add_markdown_meta(row): FILE: fastchat/serve/monitor/basic_stats.py function get_log_files (line 19) | def get_log_files(max_num_files=None): function load_log_files (line 37) | def load_log_files(filename): function load_log_files_parallel (line 59) | def load_log_files_parallel(log_files, num_threads=16): function get_anony_vote_df (line 70) | def get_anony_vote_df(df): function merge_counts (line 78) | def merge_counts(series, on, names): function report_basic_stats (line 89) | def report_basic_stats(log_files): FILE: fastchat/serve/monitor/classify/category.py class Category (line 15) | class Category: method __init__ (line 16) | def __init__(self): method create_category (line 20) | def create_category(name): method post_process (line 46) | def post_process(self): class CategoryHardPrompt (line 50) | class CategoryHardPrompt(Category): method __init__ (line 51) | def __init__(self): method get_score (line 66) | def get_score(self, judgment): method pre_process (line 80) | def pre_process(self, prompt): method post_process (line 85) | def post_process(self, judgment): class CategoryIF (line 90) | class CategoryIF(Category): method __init__ (line 91) | def __init__(self): method get_score (line 98) | def get_score(self, judgment): method pre_process (line 108) | def pre_process(self, prompt): method post_process (line 116) | def post_process(self, judgment): class CategoryMath (line 124) | class CategoryMath(Category): method __init__ (line 125) | def __init__(self): method get_score (line 132) | def get_score(self, judgment): method pre_process (line 142) | def pre_process(self, prompt): method post_process (line 150) | def post_process(self, judgment): class CategoryCreativeWriting (line 155) | class CategoryCreativeWriting(Category): method __init__ (line 156) | def __init__(self): method get_score (line 163) | def get_score(self, judgment): method pre_process (line 179) | def pre_process(self, prompt): method post_process (line 187) | def post_process(self, judgment): class CategoryCaptioning (line 196) | class CategoryCaptioning(Category): method __init__ (line 197) | def __init__(self): method get_score (line 204) | def get_score(self, judgment): method pre_process (line 214) | def pre_process(self, prompt, api_type="openai"): method post_process (line 222) | def post_process(self, judgment): class CategoryCreativeWritingVision (line 227) | class CategoryCreativeWritingVision(Category): method __init__ (line 228) | def __init__(self): method get_score (line 235) | def get_score(self, judgment): method pre_process (line 251) | def pre_process(self, prompt, api_type="openai"): method post_process (line 259) | def post_process(self, judgment): class CategoryEntityRecognition (line 265) | class CategoryEntityRecognition(Category): method __init__ (line 266) | def __init__(self): method get_score (line 273) | def get_score(self, judgment): method pre_process (line 283) | def pre_process(self, prompt, api_type="openai"): method post_process (line 291) | def post_process(self, judgment): function pil_to_base64 (line 301) | def pil_to_base64(image_path): class CategoryOpticalCharacterRecognition (line 309) | class CategoryOpticalCharacterRecognition(Category): method __init__ (line 310) | def __init__(self): method get_score (line 317) | def get_score(self, judgment): method pre_process (line 327) | def pre_process(self, prompt, api_type="openai"): method post_process (line 368) | def post_process(self, judgment): class CategoryHumor (line 373) | class CategoryHumor(Category): method __init__ (line 374) | def __init__(self): method get_score (line 381) | def get_score(self, judgment): method pre_process (line 391) | def pre_process(self, prompt, api_type="openai"): method post_process (line 430) | def post_process(self, judgment): class CategoryHomework (line 438) | class CategoryHomework(Category): method __init__ (line 439) | def __init__(self): method get_score (line 450) | def get_score(self, judgment): method pre_process (line 460) | def pre_process(self, prompt, api_type="openai"): method post_process (line 503) | def post_process(self, judgment): class CategoryDiagram (line 508) | class CategoryDiagram(Category): method __init__ (line 509) | def __init__(self): method get_score (line 524) | def get_score(self, judgment): method pre_process (line 534) | def pre_process(self, prompt, api_type="openai"): method post_process (line 577) | def post_process(self, judgment): FILE: fastchat/serve/monitor/classify/label.py function make_config (line 29) | def make_config(config_file: str) -> dict: function get_endpoint (line 36) | def get_endpoint(endpoint_list): function chat_completion_openai (line 45) | def chat_completion_openai(model, messages, temperature, max_tokens, api... function chat_completion_anthropic (line 92) | def chat_completion_anthropic(model, messages, temperature, max_tokens, ... function chat_completion_gemini (line 125) | def chat_completion_gemini( function get_answer (line 181) | def get_answer( function category_merge (line 245) | def category_merge(row): function find_required_tasks (line 263) | def find_required_tasks(row): FILE: fastchat/serve/monitor/clean_battle_data.py function remove_html (line 81) | def remove_html(raw): function to_openai_format (line 87) | def to_openai_format(messages): function replace_model_name (line 95) | def replace_model_name(old_name, tstamp): function read_file (line 116) | def read_file(filename): function read_file_parallel (line 131) | def read_file_parallel(log_files, num_threads=16): function process_data (line 140) | def process_data( function clean_battle_data (line 317) | def clean_battle_data( FILE: fastchat/serve/monitor/clean_chat_data.py function date_range (line 32) | def date_range(start="2023-04-01"): function get_log_files (line 44) | def get_log_files(max_num_files=None): function get_action_type_data (line 58) | def get_action_type_data(filename, action_type): function process_data (line 74) | def process_data(row, action_type): function clean_chat_data (line 139) | def clean_chat_data(log_files, action_type, num_parallel): FILE: fastchat/serve/monitor/copilot_arena.py function process_copilot_arena_leaderboard (line 11) | def process_copilot_arena_leaderboard(leaderboard): function build_copilot_arena_tab (line 37) | def build_copilot_arena_tab(): FILE: fastchat/serve/monitor/criteria_labeling.py function get_endpoint (line 43) | def get_endpoint(endpoint_list): function get_score (line 55) | def get_score(judgment): function chat_completion_openai (line 70) | def chat_completion_openai(model, messages, temperature, max_tokens, api... function get_answer (line 116) | def get_answer( FILE: fastchat/serve/monitor/dataset_release_scripts/arena_33k/filter_bad_conv.py class TypeCode (line 20) | class TypeCode(Enum): function detect_type (line 31) | def detect_type(conv): FILE: fastchat/serve/monitor/dataset_release_scripts/lmsys_chat_1m/compute_stats.py function to_remove (line 71) | def to_remove(x): FILE: fastchat/serve/monitor/dataset_release_scripts/lmsys_chat_1m/filter_bad_conv.py class TypeCode (line 28) | class TypeCode(Enum): function detect_type (line 39) | def detect_type(conv): FILE: fastchat/serve/monitor/elo_analysis.py function get_median_elo_from_bootstrap (line 31) | def get_median_elo_from_bootstrap(bootstrap_df): function compute_pairwise_win_fraction (line 37) | def compute_pairwise_win_fraction(battles, model_order, limit_show_numbe... function visualize_leaderboard_table (line 79) | def visualize_leaderboard_table(rating): function visualize_pairwise_win_fraction (line 101) | def visualize_pairwise_win_fraction(battles, model_order, scale=1): function visualize_battle_count (line 124) | def visualize_battle_count(battles, model_order, scale=1): function visualize_average_win_rate (line 148) | def visualize_average_win_rate(battles, limit_show_number, scale=1): function visualize_bootstrap_elo_rating (line 164) | def visualize_bootstrap_elo_rating(df, df_final, limit_show_number, scal... function limit_user_votes (line 194) | def limit_user_votes(battles, daily_vote_per_user): function get_model_pair_stats (line 215) | def get_model_pair_stats(battles): function outlier_detect (line 239) | def outlier_detect( function filter_long_conv (line 311) | def filter_long_conv(row): function report_elo_analysis_results (line 321) | def report_elo_analysis_results( function pretty_print_elo_rating (line 467) | def pretty_print_elo_rating(rating): FILE: fastchat/serve/monitor/inspect_conv.py function get_log_files (line 13) | def get_log_files(max_num_files=None): function pretty_print_conversation (line 31) | def pretty_print_conversation(messages): function inspect_convs (line 36) | def inspect_convs(log_files): FILE: fastchat/serve/monitor/leaderboard_csv_to_html.py function model_hyperlink (line 14) | def model_hyperlink(model_name, link): FILE: fastchat/serve/monitor/monitor.py function recompute_final_ranking (line 57) | def recompute_final_ranking(arena_df): function arena_hard_title (line 70) | def arena_hard_title(date): function update_elo_components (line 82) | def update_elo_components( function update_worker (line 125) | def update_worker( function load_demo (line 138) | def load_demo(url_params, request: gr.Request): function model_hyperlink (line 143) | def model_hyperlink(model_name, link): function load_leaderboard_table_csv (line 147) | def load_leaderboard_table_csv(filename, add_hyperlink=True): function build_basic_stats_tab (line 184) | def build_basic_stats_tab(): function get_full_table (line 204) | def get_full_table(arena_df, model_table_df, model_to_score): function arena_hard_process (line 233) | def arena_hard_process(leaderboard_table_file, filepath): function get_arena_table (line 269) | def get_arena_table( function update_leaderboard_df (line 354) | def update_leaderboard_df(arena_table_vals): function update_overall_leaderboard_df (line 383) | def update_overall_leaderboard_df(arena_table_vals): function build_arena_tab (line 425) | def build_arena_tab( function build_full_leaderboard_tab (line 718) | def build_full_leaderboard_tab(elo_results, model_table_df, model_to_sco... function get_arena_category_table (line 742) | def get_arena_category_table(results_df, categories, metric="ranking"): function build_category_leaderboard_tab (line 805) | def build_category_leaderboard_tab( function get_combined_table (line 882) | def get_combined_table(elo_results, model_table_df): function build_leaderboard_tab (line 917) | def build_leaderboard_tab( function build_demo (line 1112) | def build_demo(elo_results_file, leaderboard_table_file, arena_hard_lead... FILE: fastchat/serve/monitor/monitor_md.py function make_default_md_1 (line 137) | def make_default_md_1(mirror=False): function make_default_md_2 (line 147) | def make_default_md_2(mirror=False): function make_arena_leaderboard_md (line 162) | def make_arena_leaderboard_md(arena_df, last_updated_time, vision=False): function make_category_arena_leaderboard_md (line 177) | def make_category_arena_leaderboard_md(arena_df, arena_subset_df, name="... function make_full_leaderboard_md (line 196) | def make_full_leaderboard_md(): function make_leaderboard_md_live (line 210) | def make_leaderboard_md_live(elo_results): function arena_hard_title (line 219) | def arena_hard_title(date): FILE: fastchat/serve/monitor/rating_systems.py function get_matchups_models (line 24) | def get_matchups_models(df): function preprocess_for_elo (line 31) | def preprocess_for_elo(df): function preprocess_for_bt (line 44) | def preprocess_for_bt(df): function preprocess_for_style (line 65) | def preprocess_for_style( function fit_vectorized_elo (line 110) | def fit_vectorized_elo( function compute_elo (line 139) | def compute_elo(df, k=4.0, base=10.0, init_rating=1000.0, scale=400.0): function compute_bootstrap_elo (line 153) | def compute_bootstrap_elo( function bt_loss_and_grad (line 165) | def bt_loss_and_grad(ratings, matchups, outcomes, weights, alpha=1.0): function fit_bt (line 184) | def fit_bt(matchups, outcomes, weights, n_models, alpha, tol=1e-6): function scale_and_offset (line 197) | def scale_and_offset( function compute_bt (line 213) | def compute_bt(df, base=10.0, scale=400.0, init_rating=1000, tol=1e-6): function compute_bootstrap_bt (line 220) | def compute_bootstrap_bt( function contextual_bt_loss_and_grad (line 256) | def contextual_bt_loss_and_grad( function fit_contextual_bt (line 296) | def fit_contextual_bt( function compute_style_control (line 326) | def compute_style_control( function compute_bootstrap_style_control (line 348) | def compute_bootstrap_style_control( FILE: fastchat/serve/monitor/summarize_cluster.py function truncate_string (line 19) | def truncate_string(s, l): FILE: fastchat/serve/monitor/tag_openai_moderation.py function tag_moderation (line 20) | def tag_moderation(text): function tag_openai_moderation (line 33) | def tag_openai_moderation(x): FILE: fastchat/serve/monitor/topic_clustering.py function remove_punctuation (line 24) | def remove_punctuation(input_string): function read_texts (line 33) | def read_texts(input_file, min_length, max_length, english_only): function get_embeddings (line 82) | def get_embeddings(texts, model_name, batch_size): function run_k_means (line 107) | def run_k_means(embeddings, num_clusters): function run_agg_cluster (line 126) | def run_agg_cluster(embeddings, num_clusters): function run_hdbscan_cluster (line 148) | def run_hdbscan_cluster(embeddings): function get_topk_indices (line 171) | def get_topk_indices(centers, labels, embeddings, topk): function print_topk (line 187) | def print_topk(texts, labels, topk_indices, show_cut_off): function get_cluster_info (line 200) | def get_cluster_info(texts, labels, topk_indices): FILE: fastchat/serve/monitor/vote_time_stats/analyze_data.py function _serialize_json (line 8) | def _serialize_json(data): function process_record (line 29) | def process_record(r): function process_file (line 81) | def process_file(infile: str, outfile: str): FILE: fastchat/serve/multi_model_worker.py function release_worker_semaphore (line 72) | def release_worker_semaphore(): function acquire_worker_semaphore (line 76) | def acquire_worker_semaphore(): function create_background_tasks (line 86) | def create_background_tasks(): function api_generate_stream (line 98) | async def api_generate_stream(request: Request): function api_generate (line 108) | async def api_generate(request: Request): function api_get_embeddings (line 118) | async def api_get_embeddings(request: Request): function api_get_status (line 128) | async def api_get_status(request: Request): function api_count_token (line 137) | async def api_count_token(request: Request): function api_get_conv (line 144) | async def api_get_conv(request: Request): function api_model_details (line 151) | async def api_model_details(request: Request): function create_multi_model_worker (line 157) | def create_multi_model_worker(): FILE: fastchat/serve/openai_api_server.py function fetch_remote (line 73) | async def fetch_remote(url, pload=None, name=None): class AppSettings (line 97) | class AppSettings(BaseSettings): function check_api_key (line 109) | async def check_api_key( function create_error_response (line 131) | def create_error_response(code: int, message: str) -> JSONResponse: function validation_exception_handler (line 138) | async def validation_exception_handler(request, exc): function check_model (line 142) | async def check_model(request) -> Optional[JSONResponse]: function check_length (line 155) | async def check_length(request, prompt, max_tokens, worker_addr): function check_requests (line 180) | def check_requests(request) -> Optional[JSONResponse]: function process_input (line 228) | def process_input(model_name, inp): function create_openai_logprobs (line 252) | def create_openai_logprobs(logprob_dict): function _add_to_set (line 257) | def _add_to_set(s, new_stop): function get_gen_params (line 266) | async def get_gen_params( function get_worker_address (line 367) | async def get_worker_address(model_name: str) -> str: function get_conv (line 387) | async def get_conv(model_name: str, worker_addr: str): function show_available_models (line 398) | async def show_available_models(): function create_chat_completion (line 412) | async def create_chat_completion(request: ChatCompletionRequest): function chat_completion_stream_generator (line 486) | async def chat_completion_stream_generator( function create_completion (line 543) | async def create_completion(request: CompletionRequest): function generate_completion_stream_generator (line 621) | async def generate_completion_stream_generator( function generate_completion_stream (line 680) | async def generate_completion_stream(payload: Dict[str, Any], worker_add... function generate_completion (line 702) | async def generate_completion(payload: Dict[str, Any], worker_addr: str): function create_embeddings (line 708) | async def create_embeddings(request: EmbeddingsRequest, model_name: str ... function get_embedding (line 754) | async def get_embedding(payload: Dict[str, Any]): function count_tokens (line 767) | async def count_tokens(request: APITokenCheckRequest): function create_chat_completion (line 802) | async def create_chat_completion(request: APIChatCompletionRequest): function create_openai_api_server (line 878) | def create_openai_api_server(): FILE: fastchat/serve/remote_logger.py function get_remote_logger (line 13) | def get_remote_logger(): class EmptyLogger (line 24) | class EmptyLogger: method __init__ (line 27) | def __init__(self): method log (line 30) | def log(self, _data: dict): class RemoteLogger (line 34) | class RemoteLogger: method __init__ (line 37) | def __init__(self, url: str): method log (line 44) | def log(self, data: dict): method _send_logs (line 47) | def _send_logs(self): FILE: fastchat/serve/sglang_worker.py function pipeline (line 34) | def pipeline(s, prompt, max_tokens): class SGLWorker (line 43) | class SGLWorker(BaseModelWorker): method __init__ (line 44) | def __init__( method generate_stream (line 81) | async def generate_stream(self, params): method generate_stream_gate (line 164) | async def generate_stream_gate(self, params): method generate_gate (line 175) | async def generate_gate(self, params): function release_worker_semaphore (line 181) | def release_worker_semaphore(): function acquire_worker_semaphore (line 185) | def acquire_worker_semaphore(): function create_background_tasks (line 191) | def create_background_tasks(): function api_generate_stream (line 198) | async def api_generate_stream(request: Request): function api_generate (line 207) | async def api_generate(request: Request): function api_get_status (line 216) | async def api_get_status(request: Request): function api_count_token (line 221) | async def api_count_token(request: Request): function api_get_conv (line 227) | async def api_get_conv(request: Request): function api_model_details (line 232) | async def api_model_details(request: Request): FILE: fastchat/serve/test_message.py function main (line 10) | def main(): FILE: fastchat/serve/test_throughput.py function main (line 12) | def main(): FILE: fastchat/serve/vision/create_vqa_examples_dir.py function download_images_and_create_json (line 20) | def download_images_and_create_json( FILE: fastchat/serve/vision/image.py class ImageFormat (line 8) | class ImageFormat(IntEnum): class Image (line 18) | class Image(BaseModel): method convert_image_to_base64 (line 24) | def convert_image_to_base64(self): method to_openai_image_format (line 46) | def to_openai_image_format(self): method resize_image_and_return_image_in_bytes (line 59) | def resize_image_and_return_image_in_bytes(self, image, max_image_size... method convert_url_to_image_bytes (line 96) | def convert_url_to_image_bytes(self, max_image_size_mb): method to_conversation_format (line 118) | def to_conversation_format(self, max_image_size_mb): FILE: fastchat/serve/vllm_worker.py class VLLMWorker (line 31) | class VLLMWorker(BaseModelWorker): method __init__ (line 32) | def __init__( method generate_stream (line 67) | async def generate_stream(self, params): method generate (line 172) | async def generate(self, params): function release_worker_semaphore (line 178) | def release_worker_semaphore(): function acquire_worker_semaphore (line 182) | def acquire_worker_semaphore(): function create_background_tasks (line 188) | def create_background_tasks(request_id): function api_generate_stream (line 199) | async def api_generate_stream(request: Request): function api_generate (line 211) | async def api_generate(request: Request): function api_get_status (line 224) | async def api_get_status(request: Request): function api_count_token (line 229) | async def api_count_token(request: Request): function api_get_conv (line 235) | async def api_get_conv(request: Request): function api_model_details (line 240) | async def api_model_details(request: Request): FILE: fastchat/train/llama2_flash_attn_monkey_patch.py function apply_rotary_pos_emb (line 18) | def apply_rotary_pos_emb(q, k, cos_sin, position_ids): function forward (line 32) | def forward( function _prepare_decoder_attention_mask (line 108) | def _prepare_decoder_attention_mask( function replace_llama_attn_with_flash_attn (line 132) | def replace_llama_attn_with_flash_attn(): function test (line 144) | def test(): FILE: fastchat/train/llama_flash_attn_monkey_patch.py function forward (line 13) | def forward( function _prepare_decoder_attention_mask (line 90) | def _prepare_decoder_attention_mask( function replace_llama_attn_with_flash_attn (line 97) | def replace_llama_attn_with_flash_attn(): FILE: fastchat/train/llama_xformers_attn_monkey_patch.py function replace_llama_attn_with_xformers_attn (line 19) | def replace_llama_attn_with_xformers_attn(): function xformers_forward (line 23) | def xformers_forward( FILE: fastchat/train/train.py class ModelArguments (line 37) | class ModelArguments: class DataArguments (line 51) | class DataArguments: class TrainingArguments (line 62) | class TrainingArguments(transformers.TrainingArguments): function rank0_print (line 76) | def rank0_print(*args): function trainer_save_model_safe (line 81) | def trainer_save_model_safe(trainer: transformers.Trainer): function preprocess (line 92) | def preprocess( class SupervisedDataset (line 180) | class SupervisedDataset(Dataset): method __init__ (line 183) | def __init__(self, raw_data, tokenizer: transformers.PreTrainedTokeniz... method __len__ (line 194) | def __len__(self): method __getitem__ (line 197) | def __getitem__(self, i) -> Dict[str, torch.Tensor]: class LazySupervisedDataset (line 205) | class LazySupervisedDataset(Dataset): method __init__ (line 208) | def __init__(self, raw_data, tokenizer: transformers.PreTrainedTokeniz... method __len__ (line 217) | def __len__(self): method __getitem__ (line 220) | def __getitem__(self, i) -> Dict[str, torch.Tensor]: function make_supervised_data_module (line 235) | def make_supervised_data_module( function train (line 256) | def train(): FILE: fastchat/train/train_baichuan.py class ModelArguments (line 39) | class ModelArguments: class DataArguments (line 44) | class DataArguments: class TrainingArguments (line 52) | class TrainingArguments(transformers.TrainingArguments): function rank0_print (line 66) | def rank0_print(*args): function safe_save_model_for_hf_trainer (line 71) | def safe_save_model_for_hf_trainer(trainer: transformers.Trainer, output... function apply_prompt_template (line 80) | def apply_prompt_template(sources, systems=None): function tokenize_conversations (line 100) | def tokenize_conversations(conversations, tokenizer): function mask_targets (line 112) | def mask_targets(conversations, targets, tokenizer, conv): function preprocess (line 151) | def preprocess(sources, tokenizer: transformers.PreTrainedTokenizer, **k... class SupervisedDataset (line 180) | class SupervisedDataset(Dataset): method __init__ (line 183) | def __init__(self, raw_data, tokenizer: transformers.PreTrainedTokeniz... method __len__ (line 196) | def __len__(self): method __getitem__ (line 199) | def __getitem__(self, i) -> Dict[str, torch.Tensor]: class LazySupervisedDataset (line 207) | class LazySupervisedDataset(Dataset): method __init__ (line 210) | def __init__(self, raw_data, tokenizer: transformers.PreTrainedTokeniz... method __len__ (line 218) | def __len__(self): method __getitem__ (line 221) | def __getitem__(self, i) -> Dict[str, torch.Tensor]: function make_supervised_data_module (line 240) | def make_supervised_data_module( function train (line 275) | def train(): FILE: fastchat/train/train_flant5.py class ModelArguments (line 47) | class ModelArguments: class DataArguments (line 52) | class DataArguments: class TrainingArguments (line 64) | class TrainingArguments(transformers.TrainingArguments): function safe_save_model_for_hf_trainer (line 75) | def safe_save_model_for_hf_trainer(trainer: transformers.Trainer, output... function smart_tokenizer_and_embedding_resize (line 84) | def smart_tokenizer_and_embedding_resize( function _tokenize_fn (line 115) | def _tokenize_fn( function _form_qa (line 142) | def _form_qa( function _add_speaker_and_signal (line 179) | def _add_speaker_and_signal(header, source, get_conversation=True): function preprocess (line 221) | def preprocess( class SupervisedDataset (line 266) | class SupervisedDataset(Dataset): method __init__ (line 269) | def __init__( method __len__ (line 342) | def __len__(self): method __getitem__ (line 345) | def __getitem__(self, i) -> Dict[str, torch.Tensor]: class DataCollatorForSupervisedDataset (line 350) | class DataCollatorForSupervisedDataset(object): method __call__ (line 355) | def __call__(self, instances: Sequence[Dict]) -> Dict[str, torch.Tensor]: function make_supervised_data_module (line 378) | def make_supervised_data_module( function train (line 395) | def train(): FILE: fastchat/train/train_lora.py class TrainingArguments (line 43) | class TrainingArguments(transformers.TrainingArguments): class LoraArguments (line 56) | class LoraArguments: function maybe_zero_3 (line 68) | def maybe_zero_3(param): function get_peft_state_maybe_zero_3 (line 79) | def get_peft_state_maybe_zero_3(named_params, bias): function train (line 104) | def train(): FILE: fastchat/train/train_lora_t5.py class LoraArguments (line 59) | class LoraArguments: class ModelArguments (line 70) | class ModelArguments: class DataArguments (line 75) | class DataArguments: class TrainingArguments (line 87) | class TrainingArguments(transformers.TrainingArguments): function safe_save_model_for_hf_trainer (line 98) | def safe_save_model_for_hf_trainer( function train (line 109) | def train(): FILE: fastchat/train/train_with_template.py class ModelArguments (line 39) | class ModelArguments: class DataArguments (line 44) | class DataArguments: class TrainingArguments (line 52) | class TrainingArguments(transformers.TrainingArguments): function rank0_print (line 66) | def rank0_print(*args): function safe_save_model_for_hf_trainer (line 71) | def safe_save_model_for_hf_trainer(trainer: transformers.Trainer, output... function apply_prompt_template (line 80) | def apply_prompt_template(sources, template_id, systems=None): function tokenize_conversations (line 100) | def tokenize_conversations(conversations, tokenizer): function get_prompt_separator (line 112) | def get_prompt_separator(conv): function mask_targets (line 144) | def mask_targets(conversations, targets, tokenizer, conv): function preprocess (line 198) | def preprocess( class SupervisedDataset (line 229) | class SupervisedDataset(Dataset): method __init__ (line 232) | def __init__( method __len__ (line 247) | def __len__(self): method __getitem__ (line 250) | def __getitem__(self, i) -> Dict[str, torch.Tensor]: class LazySupervisedDataset (line 258) | class LazySupervisedDataset(Dataset): method __init__ (line 261) | def __init__( method __len__ (line 272) | def __len__(self): method __getitem__ (line 275) | def __getitem__(self, i) -> Dict[str, torch.Tensor]: function make_supervised_data_module (line 295) | def make_supervised_data_module( function train (line 337) | def train(): FILE: fastchat/train/train_yuan2.py class ModelArguments (line 37) | class ModelArguments: class DataArguments (line 51) | class DataArguments: class TrainingArguments (line 65) | class TrainingArguments(transformers.TrainingArguments): function rank0_print (line 79) | def rank0_print(*args): function trainer_save_model_safe (line 84) | def trainer_save_model_safe(trainer: transformers.Trainer): function right_replace (line 96) | def right_replace(string, old, new, max=1): function preprocess (line 100) | def preprocess( class SupervisedDataset (line 316) | class SupervisedDataset(Dataset): method __init__ (line 319) | def __init__( method __len__ (line 332) | def __len__(self): method __getitem__ (line 335) | def __getitem__(self, i) -> Dict[str, torch.Tensor]: class LazySupervisedDataset (line 343) | class LazySupervisedDataset(Dataset): method __init__ (line 346) | def __init__( method __len__ (line 358) | def __len__(self): method __getitem__ (line 361) | def __getitem__(self, i) -> Dict[str, torch.Tensor]: function make_supervised_data_module (line 378) | def make_supervised_data_module( function train (line 399) | def train(): FILE: fastchat/utils.py function build_logger (line 26) | def build_logger(logger_name, logger_filename): class StreamToLogger (line 84) | class StreamToLogger(object): method __init__ (line 89) | def __init__(self, logger, log_level=logging.INFO): method __getattr__ (line 95) | def __getattr__(self, attr): method write (line 98) | def write(self, buf): method flush (line 113) | def flush(self): function disable_torch_init (line 120) | def disable_torch_init(): function get_gpu_memory (line 130) | def get_gpu_memory(max_gpus=None): function oai_moderation (line 152) | def oai_moderation(text, custom_thresholds=None): function moderation_filter (line 177) | def moderation_filter(text, model_list, do_moderation=False): function clean_flant5_ckpt (line 208) | def clean_flant5_ckpt(ckpt_path): function pretty_print_semaphore (line 232) | def pretty_print_semaphore(semaphore): function iter_over_async (line 276) | def iter_over_async( function detect_language (line 302) | def detect_language(text: str) -> str: function parse_gradio_auth_creds (line 318) | def parse_gradio_auth_creds(filename: str): function is_partial_stop (line 331) | def is_partial_stop(output: str, stop_str: str): function run_cmd (line 339) | def run_cmd(cmd: str): function is_sentence_complete (line 345) | def is_sentence_complete(output: str): function get_context_length (line 364) | def get_context_length(config): function str_to_torch_dtype (line 379) | def str_to_torch_dtype(dtype: str): function load_image (line 394) | def load_image(image_file): function upload_image_file_to_gcs (line 415) | def upload_image_file_to_gcs(image, filename): function get_image_file_from_gcs (line 433) | def get_image_file_from_gcs(filename): function image_moderation_request (line 444) | def image_moderation_request(image_bytes, endpoint, api_key): function image_moderation_provider (line 458) | def image_moderation_provider(image, api_type): function image_moderation_filter (line 474) | def image_moderation_filter(image): FILE: playground/benchmark/benchmark_api_provider.py class Metrics (line 16) | class Metrics: method __init__ (line 17) | def __init__(self): method to_dict (line 21) | def to_dict(self): function sample_image_and_question (line 25) | def sample_image_and_question(random_questions_dict, index): function call_model (line 37) | def call_model( function run_benchmark (line 76) | def run_benchmark(model_name, model_api_dict, random_questions_dict, num... function benchmark_models (line 100) | def benchmark_models(api_endpoint_info, random_questions_dict, models): function main (line 116) | def main(api_endpoint_file, random_questions, output_file): FILE: playground/test_embedding/test_classification.py function get_embedding_from_api (line 16) | def get_embedding_from_api(word, model="vicuna-7b-v1.1"): function create_embedding_data_frame (line 38) | def create_embedding_data_frame(data_path, model, max_tokens=500): function train_random_forest (line 55) | def train_random_forest(df): FILE: playground/test_embedding/test_semantic_search.py function cosine_similarity (line 11) | def cosine_similarity(vec1, vec2): function get_embedding_from_api (line 18) | def get_embedding_from_api(word, model="vicuna-7b-v1.1"): function create_embedding_data_frame (line 40) | def create_embedding_data_frame(data_path, model, max_tokens=500): function search_reviews (line 57) | def search_reviews(df, product_description, n=3, pprint=False, model="vi... function print_model_search (line 76) | def print_model_search(input_path, model): FILE: playground/test_embedding/test_sentence_similarity.py function get_embedding_from_api (line 10) | def get_embedding_from_api(word, model="vicuna-7b-v1.5"): function cosine_similarity (line 32) | def cosine_similarity(vec1, vec2): function print_cosine_similarity (line 36) | def print_cosine_similarity(embeddings, texts): FILE: tests/launch_openai_api_test_server.py function launch_process (line 8) | def launch_process(cmd): FILE: tests/load_test.py function litellm_completion (line 12) | def litellm_completion(args, tokenizer, image_url=None): function main (line 66) | def main(args): FILE: tests/test_cli.py function test_single_gpu (line 8) | def test_single_gpu(): function test_multi_gpu (line 38) | def test_multi_gpu(): function test_8bit (line 54) | def test_8bit(): function test_hf_api (line 70) | def test_hf_api(): FILE: tests/test_image_utils.py function check_byte_size_in_mb (line 21) | def check_byte_size_in_mb(image_base64_str): function generate_random_image (line 25) | def generate_random_image(target_size_mb, image_format="PNG"): class DontResizeIfLessThanMaxTest (line 55) | class DontResizeIfLessThanMaxTest(unittest.TestCase): method test_dont_resize_if_less_than_max (line 56) | def test_dont_resize_if_less_than_max(self): class ResizeLargeImageForModerationEndpoint (line 73) | class ResizeLargeImageForModerationEndpoint(unittest.TestCase): method test_resize_large_image_and_send_to_moderation_filter (line 74) | def test_resize_large_image_and_send_to_moderation_filter(self): class DontResizeIfMaxImageSizeIsNone (line 83) | class DontResizeIfMaxImageSizeIsNone(unittest.TestCase): method test_dont_resize_if_max_image_size_is_none (line 84) | def test_dont_resize_if_max_image_size_is_none(self): class OpenAIConversationDontResizeImage (line 100) | class OpenAIConversationDontResizeImage(unittest.TestCase): method test (line 101) | def test(self): class ClaudeConversationResizesCorrectly (line 116) | class ClaudeConversationResizesCorrectly(unittest.TestCase): method test (line 117) | def test(self): FILE: tests/test_openai_api.py function test_list_models (line 17) | def test_list_models(): function test_completion (line 23) | def test_completion(model, logprob): function test_completion_stream (line 41) | def test_completion_stream(model): function test_embedding (line 57) | def test_embedding(model): function test_chat_completion (line 63) | def test_chat_completion(model): function test_chat_completion_stream (line 72) | def test_chat_completion_stream(model): function test_openai_curl (line 88) | def test_openai_curl(): FILE: tests/test_openai_langchain.py function test_chain (line 15) | def test_chain(): FILE: tests/test_openai_vision_api.py function encode_image (line 16) | def encode_image(image): function test_list_models (line 36) | def test_list_models(): function test_chat_completion (line 42) | def test_chat_completion(model): function test_chat_completion_stream (line 97) | def test_chat_completion_stream(model): function test_openai_curl (line 123) | def test_openai_curl():