SYMBOL INDEX (1858 symbols across 136 files) FILE: data/create_data_cards.py function test_create_data_cards (line 101) | def test_create_data_cards(dataset_name, link_to_source): FILE: dev_installers/mac/mac_run_app.py function main (line 30) | def main(): FILE: finetune.py function log (line 19) | def log(*args, **kwargs): function train (line 30) | def train( function tokenize (line 580) | def tokenize(prompt, tokenizer, cutoff_len, add_eos_token=False): function prune_long_sequences (line 603) | def prune_long_sequences(data_point, cutoff_len=None): function generate_and_tokenize_prompt (line 614) | def generate_and_tokenize_prompt(data_point, prompt_type=None, train_on_... function test_debug (line 640) | def test_debug(): function entrypoint_main (line 644) | def entrypoint_main(): FILE: generate.py function entrypoint_main (line 15) | def entrypoint_main(): FILE: gradio_utils/css.py function get_css (line 1) | def get_css(kwargs, select_string) -> str: function make_css_base (line 14) | def make_css_base(select_string) -> str: FILE: gradio_utils/google_auth.py function setup_app (line 5) | def setup_app(name_login='google_login', name_app='h2ogpt', verbose=False): function login_gradio (line 121) | def login_gradio(**kwargs): function get_app (line 144) | def get_app(demo, app_kwargs={}, **login_kwargs): FILE: gradio_utils/grclient.py function check_job (line 66) | def check_job(job, timeout=0.0, raise_exception=True, verbose=False): class LangChainAction (line 83) | class LangChainAction(Enum): class CommonClient (line 110) | class CommonClient: method question (line 111) | def question(self, instruction, *args, **kwargs) -> str: method question_stream (line 123) | def question_stream( method query (line 135) | def query(self, query, *args, **kwargs) -> str: method query_stream (line 146) | def query_stream(self, query, *args, **kwargs) -> Generator[ReturnType... method summarize (line 155) | def summarize(self, *args, query=None, focus=None, **kwargs) -> str: method summarize_stream (line 170) | def summarize_stream(self, *args, query=None, focus=None, **kwargs) ->... method extract (line 183) | def extract(self, *args, query=None, focus=None, **kwargs) -> list[str]: method extract_stream (line 198) | def extract_stream(self, *args, query=None, focus=None, **kwargs) -> l... method get_client_kwargs (line 211) | def get_client_kwargs(self, **kwargs): method get_query_kwargs (line 259) | def get_query_kwargs(self, **kwargs): method check_error (line 268) | def check_error(res_dict): method query_or_summarize_or_extract (line 283) | def query_or_summarize_or_extract( method check_model (line 1007) | def check_model(self, model): method _get_ttl_hash (line 1027) | def _get_ttl_hash(seconds=60): method _get_models_full (line 1032) | def _get_models_full(self, ttl_hash=None, do_lock=False) -> List[Dict[... method get_models_full (line 1049) | def get_models_full(self, do_lock=False) -> List[Dict[str, Any]]: method list_models (line 1055) | def list_models(self) -> List[str]: method simple_stream (line 1061) | def simple_stream( method stream (line 1188) | def stream( method _stream (line 1236) | def _stream( method yield_res (line 1300) | def yield_res( class H2OGradioClient (line 1366) | class H2OGradioClient(CommonClient, Client): method reset_session (line 1372) | def reset_session(self) -> None: method __init__ (line 1377) | def __init__( method __repr__ (line 1478) | def __repr__(self): method __str__ (line 1484) | def __str__(self): method setup (line 1490) | def setup(self): method get_endpoints (line 1584) | def get_endpoints(client, verbose=False): method is_full_git_hash (line 1622) | def is_full_git_hash(s): method get_server_hash (line 1626) | def get_server_hash(self) -> str: method _get_server_hash (line 1629) | def _get_server_hash(self, ttl_hash=None) -> str: method refresh_client_if_should (line 1653) | def refresh_client_if_should(self): method refresh_client (line 1675) | def refresh_client(self): method clone (line 1717) | def clone(self, do_lock=False): method _clone (line 1724) | def _clone(self): method submit (line 1739) | def submit( class CloneableGradioClient (line 1787) | class CloneableGradioClient(CommonClient, Client): method __init__ (line 1788) | def __init__(self, *args, **kwargs): method _initialize_session_specific (line 1801) | def _initialize_session_specific(self): method _initialize_shared_info (line 1811) | def _initialize_shared_info(self): method config (line 1825) | def config(self): method config (line 1829) | def config(self, value): method _info (line 1833) | def _info(self): method _info (line 1837) | def _info(self, value): method endpoints (line 1841) | def endpoints(self): method endpoints (line 1845) | def endpoints(self, value): method executor (line 1849) | def executor(self): method executor (line 1853) | def executor(self, value): method heartbeat (line 1857) | def heartbeat(self): method heartbeat (line 1861) | def heartbeat(self, value): method setup (line 1864) | def setup(self): method _get_ttl_hash (line 1869) | def _get_ttl_hash(seconds=60): method get_server_hash (line 1873) | def get_server_hash(self) -> str: method _get_server_hash (line 1876) | def _get_server_hash(self, ttl_hash=None): method clone (line 1880) | def clone(self): method __repr__ (line 1888) | def __repr__(self): method __str__ (line 1893) | def __str__(self): method cleanup (line 1898) | def cleanup(self): FILE: gradio_utils/prompt_form.py function get_chatbot_name (line 13) | def get_chatbot_name(base_model, display_name, model_path_llama, inferen... function get_avatars (line 40) | def get_avatars(base_model, model_path_llama, inference_server=''): function ratingfn1 (line 97) | def ratingfn1(): function ratingfn2 (line 101) | def ratingfn2(): function ratingfn3 (line 105) | def ratingfn3(): function ratingfn4 (line 109) | def ratingfn4(): function ratingfn5 (line 113) | def ratingfn5(): function submit_review (line 117) | def submit_review(review_text, text_output, text_output2, *text_outputs1... function make_chatbots (line 137) | def make_chatbots(output_label0, output_label0_model2, **kwargs): FILE: gradio_utils/yield_utils.py class ReturnType (line 4) | class ReturnType(BaseModel): FILE: iterators/iterator_pipe.py class IteratorPipe (line 5) | class IteratorPipe: method __init__ (line 10) | def __init__(self, sentinel=object()): method __iter__ (line 16) | def __iter__(self): method __next__ (line 19) | def __next__(self): method put (line 30) | def put(self, data) -> bool: method close (line 41) | def close(self): class AsyncIteratorPipe (line 52) | class AsyncIteratorPipe: method __init__ (line 54) | def __init__(self, sentinel=object()): method __aiter__ (line 60) | def __aiter__(self): method __anext__ (line 63) | async def __anext__(self): method put (line 74) | async def put(self, data) -> bool: method close (line 85) | async def close(self): FILE: iterators/timeout_iterator.py class TimeoutIterator (line 7) | class TimeoutIterator: method __init__ (line 23) | def __init__(self, iterator, timeout=0.0, sentinel=object(), method get_sentinel (line 39) | def get_sentinel(self): method set_reset_on_next (line 42) | def set_reset_on_next(self, reset_on_next): method set_timeout (line 45) | def set_timeout(self, timeout: float): method interrupt (line 51) | def interrupt(self): method __iter__ (line 59) | def __iter__(self): method __next__ (line 62) | def __next__(self): method __lookahead (line 99) | def __lookahead(self): class AsyncTimeoutIterator (line 111) | class AsyncTimeoutIterator: method __init__ (line 117) | def __init__(self, iterator, timeout=0.0, sentinel=object(), reset_on_... method get_sentinel (line 128) | def get_sentinel(self): method set_reset_on_next (line 131) | def set_reset_on_next(self, reset_on_next): method set_timeout (line 134) | def set_timeout(self, timeout: float): method interrupt (line 137) | def interrupt(self): method __aiter__ (line 140) | def __aiter__(self): method __anext__ (line 143) | async def __anext__(self): method __lookahead (line 167) | async def __lookahead(self): FILE: metrics/quip.py class Quip (line 105) | class Quip(evaluate.Metric): method __init__ (line 106) | def __init__(self, **kwargs): method _info (line 130) | def _info(self): method _compute (line 161) | def _compute( method get_reduced_size (line 213) | def get_reduced_size(self, reduced_query, verbose=True): FILE: models/create_model_cards.py function test_create_model_cards (line 224) | def test_create_model_cards(model_name, base_model, dataset, training_lo... FILE: models/gpu_mem_track.py function get_mem_space (line 32) | def get_mem_space(x): function file_writer (line 43) | def file_writer(file_name = None): class MemTracker (line 52) | class MemTracker(object): method __init__ (line 62) | def __init__(self, detail=True, path='', verbose=False, device=0, log_... method get_tensors (line 71) | def get_tensors(self): method get_tensor_usage (line 84) | def get_tensor_usage(self): method get_allocate_usage (line 88) | def get_allocate_usage(self): method clear_cache (line 91) | def clear_cache(self): method print_all_gpu_tensor (line 95) | def print_all_gpu_tensor(self, file=None): method track (line 99) | def track(self): FILE: models/predict_aquila.py class SeparatorStyle (line 35) | class SeparatorStyle(IntEnum): class Conversation (line 47) | class Conversation: method get_prompt (line 71) | def get_prompt(self) -> str: method set_system_message (line 125) | def set_system_message(self, system_message: str): method append_message (line 129) | def append_message(self, role: str, message: str): method update_last_message (line 133) | def update_last_message(self, message: str): method copy (line 141) | def copy(self): method dict (line 156) | def dict(self): function register_conv_template (line 170) | def register_conv_template(template: Conversation, override: bool = False): function get_conv_template (line 180) | def get_conv_template(name: str) -> Conversation: function get_conversation_template (line 184) | def get_conversation_template(model_path: str) -> Conversation: function set_random_seed (line 297) | def set_random_seed(seed): function covert_prompt_to_input_ids_with_history (line 304) | def covert_prompt_to_input_ids_with_history(text, history, tokenizer, ma... function predict (line 329) | def predict(model, text, tokenizer=None, FILE: models/test_scrape1.py function test_get_models (line 15) | def test_get_models(model_name): FILE: openai_server/agent_prompting.py function agent_system_prompt (line 13) | def agent_system_prompt(agent_code_writer_system_message, agent_system_s... function get_chat_doc_context (line 209) | def get_chat_doc_context(text_context_list, image_file, agent_work_dir, ... function get_ask_question_about_image_helper (line 376) | def get_ask_question_about_image_helper(base_url, api_key, model): function get_mermaid_renderer_helper (line 417) | def get_mermaid_renderer_helper(): function get_image_generation_helper (line 437) | def get_image_generation_helper(): function get_audio_transcription_helper (line 502) | def get_audio_transcription_helper(): function get_query_to_web_image_helper (line 524) | def get_query_to_web_image_helper(): function get_aider_coder_helper (line 544) | def get_aider_coder_helper(base_url, api_key, model, autogen_timeout, de... function get_rag_helper (line 570) | def get_rag_helper(base_url, api_key, model, autogen_timeout, text_conte... function get_convert_to_text_helper (line 603) | def get_convert_to_text_helper(): function get_download_web_video_helper (line 628) | def get_download_web_video_helper(): function get_serp_helper (line 649) | def get_serp_helper(): function get_semantic_scholar_helper (line 680) | def get_semantic_scholar_helper(): function get_wolfram_alpha_helper (line 702) | def get_wolfram_alpha_helper(): function get_dai_helper (line 724) | def get_dai_helper(): function get_news_api_helper (line 750) | def get_news_api_helper(): function get_bing_search_helper (line 773) | def get_bing_search_helper(): function get_api_helper (line 809) | def get_api_helper(): function get_agent_tools (line 835) | def get_agent_tools(): function get_full_system_prompt (line 844) | def get_full_system_prompt(agent_code_writer_system_message, agent_syste... function planning_prompt (line 920) | def planning_prompt(query): function planning_final_prompt (line 941) | def planning_final_prompt(query): FILE: openai_server/agent_tools/aider_code_generation.py function install_aider (line 14) | def install_aider(): function main (line 20) | def main(): FILE: openai_server/agent_tools/ask_question_about_documents.py function has_gpu (line 13) | def has_gpu(): function get_rag_answer (line 22) | def get_rag_answer(prompt, function ask_question_about_documents (line 99) | def ask_question_about_documents(): FILE: openai_server/agent_tools/ask_question_about_image.py function convert_svg_to_png (line 17) | def convert_svg_to_png(svg_path): function convert_pdf_to_images (line 24) | def convert_pdf_to_images(pdf_path): function process_file (line 35) | def process_file(file_path): function main (line 48) | def main(): FILE: openai_server/agent_tools/audio_transcription.py function check_valid_extension (line 6) | def check_valid_extension(file): function main (line 25) | def main(): FILE: openai_server/agent_tools/bing_search.py function setup_argparse (line 23) | def setup_argparse(): function search_web (line 39) | def search_web(client, args): function search_images (line 50) | def search_images(client, args): function search_news (line 61) | def search_news(client, args): function search_videos (line 72) | def search_videos(client, args): function print_web_result (line 83) | def print_web_result(result, args): function print_image_result (line 93) | def print_image_result(result, args): function print_news_result (line 103) | def print_news_result(result, args): function print_video_result (line 115) | def print_video_result(result, args): function print_info (line 126) | def print_info(info, args): function bing_search (line 141) | def bing_search(): FILE: openai_server/agent_tools/common/utils.py function is_url_valid_and_alive (line 9) | def is_url_valid_and_alive(url, timeout=5): function filename_is_url (line 24) | def filename_is_url(filename): function download_simple (line 31) | def download_simple(url, dest=None, overwrite=False, verbose=False): FILE: openai_server/agent_tools/convert_document_to_text.py function has_gpu (line 11) | def has_gpu(): function pdf_has_images (line 20) | def pdf_has_images(pdf_path): function get_num_pages (line 33) | def get_num_pages(file): function convert_to_csv (line 42) | def convert_to_csv(file): function sources_to_text (line 56) | def sources_to_text(sources1): function process_files (line 76) | def process_files(files, urls): function get_text (line 194) | def get_text(files, urls): function main (line 206) | def main(): FILE: openai_server/agent_tools/download_web_video.py function selenium (line 6) | def selenium(base_url, video_url): function download_web_video (line 71) | def download_web_video(video_url, base_url="https://www.youtube.com", ou... function main (line 96) | def main(): FILE: openai_server/agent_tools/driverless_ai_data_science.py function connect_to_h2o_engine (line 10) | def connect_to_h2o_engine(token: str, client_id, token_endpoint_url, env... function connect_to_driverless_ai (line 38) | def connect_to_driverless_ai(engine_manager, dai_engine: str = None): function create_dataset (line 60) | def create_dataset(dai, data_url: str, dataset_name: str, data_source: s... function split_dataset (line 72) | def split_dataset(dataset, train_size: float, train_name: str, test_name... function create_experiment (line 90) | def create_experiment(dai, dataset_split, target_column: str, scorer: st... function get_experiment_from_key (line 131) | def get_experiment_from_key(experiment_key, token, client_id, token_endp... function visualize_importance (line 142) | def visualize_importance(experiment): function print_experiment_details (line 168) | def print_experiment_details(experiment): function plot_roc_curve (line 188) | def plot_roc_curve(roc_data, save_dir='plots'): function plot_precision_recall (line 206) | def plot_precision_recall(pr_data, save_dir='plots'): function plot_gains_chart (line 222) | def plot_gains_chart(gains_data, save_dir='plots'): function plot_lift_chart (line 239) | def plot_lift_chart(lift_data, save_dir='plots'): function plot_ks_chart (line 257) | def plot_ks_chart(ks_data, save_dir='plots'): function plot_all_charts (line 273) | def plot_all_charts(roc_curve, prec_recall_curve, gains_chart, lift_char... function key_to_experiment (line 344) | def key_to_experiment(experiment_key, client_id, dai_engine, token_endpo... function get_artifacts (line 353) | def get_artifacts(experiment=None, experiment_key=None, client_id=None, ... function main (line 417) | def main(): FILE: openai_server/agent_tools/google_search.py function setup_argparse (line 85) | def setup_argparse(): function validate_language (line 123) | def validate_language(hl: str) -> str: function validate_country (line 129) | def validate_country(gl: str) -> str: function perform_search (line 135) | def perform_search(args) -> Dict[str, Any]: function save_results_to_file (line 191) | def save_results_to_file(results: Dict[str, Any], filename: str) -> None: function print_results (line 203) | def print_results(results: Dict[str, Any], args): function google_search (line 264) | def google_search(): FILE: openai_server/agent_tools/image_generation.py function main (line 9) | def main(): function get_image_format (line 157) | def get_image_format(image_data): FILE: openai_server/agent_tools/mermaid_renderer.py function generate_unique_filename (line 12) | def generate_unique_filename(format): function find_chrome_path (line 18) | def find_chrome_path(): function render_mermaid (line 37) | def render_mermaid(mermaid_code, output_file, format='svg'): function main (line 108) | def main(): FILE: openai_server/agent_tools/news_query.py function fetch_everything (line 7) | def fetch_everything(api_key, query, sources, from_date, to_date, sort_b... function fetch_top_headlines (line 27) | def fetch_top_headlines(api_key, sources, country, category, page_size): function display_articles (line 46) | def display_articles(articles): function main (line 57) | def main(): FILE: openai_server/agent_tools/query_to_web_image.py function download_image (line 18) | def download_image(text, file, save_dir='.'): function main (line 59) | def main(): FILE: openai_server/agent_tools/scholar_papers_query.py function setup_argparse (line 9) | def setup_argparse(): function search_papers_semanticscholar (line 34) | def search_papers_semanticscholar(sch, args): function search_papers_arxiv (line 48) | def search_papers_arxiv(args): function print_paper_info_semanticscholar (line 58) | def print_paper_info_semanticscholar(paper, index, args): function print_paper_info_arxiv (line 85) | def print_paper_info_arxiv(paper, index, args): function print_info (line 99) | def print_info(info, args): function download_pdf_semanticscholar (line 118) | def download_pdf_semanticscholar(paper, output_dir): function download_pdf_arxiv (line 127) | def download_pdf_arxiv(paper, output_dir): function download_pdf (line 133) | def download_pdf(pdf_url, filename): function main (line 144) | def main(): FILE: openai_server/agent_tools/wolfram_alpha_math_science_query.py function sanitize_filename (line 7) | def sanitize_filename(name): function extract_and_save_images (line 14) | def extract_and_save_images(query, app_id, output_dir): function main (line 79) | def main(): FILE: openai_server/agent_utils.py function get_have_internet (line 15) | def get_have_internet(): function is_image_file (line 27) | def is_image_file(filename): function identify_image_files (line 36) | def identify_image_files(file_list): function in_pycharm (line 52) | def in_pycharm(): function get_inner_function_signature (line 56) | def get_inner_function_signature(func): function filter_kwargs (line 67) | def filter_kwargs(func, kwargs): function set_python_path (line 74) | def set_python_path(): function current_datetime (line 91) | def current_datetime(): function run_agent (line 108) | def run_agent(run_agent_func=None, function set_dummy_term (line 126) | def set_dummy_term(): function fix_markdown_image_paths (line 143) | def fix_markdown_image_paths(text): function get_ret_dict_and_handle_files (line 190) | def get_ret_dict_and_handle_files(chat_result, chat_result_planning, function guardrail_files (line 344) | def guardrail_files(file_list, hard_fail=False): function is_binary_file (line 379) | def is_binary_file(file_path, sample_size=1024): function extract_agent_tool (line 390) | def extract_agent_tool(input_string): function get_openai_client (line 410) | def get_openai_client(max_time=120): FILE: openai_server/autogen_2agent_backend.py function run_autogen_2agent (line 13) | def run_autogen_2agent(query=None, FILE: openai_server/autogen_agents.py function get_code_execution_agent (line 5) | def get_code_execution_agent( function get_code_writer_agent (line 23) | def get_code_writer_agent( function get_chat_agent (line 42) | def get_chat_agent( function get_human_proxy_agent (line 86) | def get_human_proxy_agent( function get_code_group_chat_manager (line 103) | def get_code_group_chat_manager( function get_main_group_chat_manager (line 166) | def get_main_group_chat_manager( FILE: openai_server/autogen_multi_agent_backend.py function run_autogen_multi_agent (line 14) | def run_autogen_multi_agent(query=None, FILE: openai_server/autogen_streaming.py class CustomOutputStream (line 14) | class CustomOutputStream(OutputStream): method print (line 15) | def print(self, *objects, sep="", end="", flush=False): method dump (line 19) | def dump(self, *objects, sep="", end="", flush=False): class CustomIOStream (line 24) | class CustomIOStream(IOStream, CustomOutputStream): class CaptureIOStream (line 28) | class CaptureIOStream(IOStream): method __init__ (line 29) | def __init__(self, output_queue: queue.Queue): method print (line 32) | def print(self, *objects: typing.Any, sep: str = "", end: str = "", fl... function capture_iostream (line 39) | def capture_iostream(output_queue: queue.Queue) -> typing.Generator[Capt... function run_autogen_in_proc (line 45) | def run_autogen_in_proc(func, output_queue, result_queue, exception_queu... function iostream_generator (line 62) | async def iostream_generator(func, use_process=False, **kwargs) -> typin... FILE: openai_server/autogen_utils.py class H2OCodeBlock (line 53) | class H2OCodeBlock(CodeBlock): class H2OLocalCommandLineCodeExecutor (line 59) | class H2OLocalCommandLineCodeExecutor(LocalCommandLineCodeExecutor): method __init__ (line 60) | def __init__( method remove_comments_strings (line 94) | def remove_comments_strings(code: str, lang: str) -> str: method sanitize_command (line 120) | def sanitize_command(lang: str, code: str) -> None: method _get_file_name_from_content (line 242) | def _get_file_name_from_content(self, code: str, workspace_path: Path)... method __execute_code_dont_check_setup (line 272) | def __execute_code_dont_check_setup(self, code_blocks: List[CodeBlock]... method is_in_container (line 388) | def is_in_container() -> bool: method _execute_code_dont_check_setup (line 399) | def _execute_code_dont_check_setup(self, code_blocks: List[CodeBlock])... method update_agent_tool_usages (line 479) | def update_agent_tool_usages(self, code_blocks: List[CodeBlock]) -> None: method executed_code_note (line 495) | def executed_code_note(ret: CommandLineCodeResult, method agent_tool_usage_note (line 513) | def agent_tool_usage_note(self, ret) -> CommandLineCodeResult: method output_guardrail (line 529) | def output_guardrail(ret: CommandLineCodeResult) -> CommandLineCodeRes... method text_guardrail (line 534) | def text_guardrail(text, any_fail=False, max_bad_lines=3, just_filter_... method truncate_output (line 645) | def truncate_output(ret: CommandLineCodeResult) -> CommandLineCodeResult: function backoff_handler (line 684) | def backoff_handler(details): class H2OConversableAgent (line 689) | class H2OConversableAgent(ConversableAgent): method __init__ (line 696) | def __init__( method _generate_oai_reply_from_client (line 838) | def _generate_oai_reply_from_client(self, llm_client, messages, cache)... method generate_oai_reply (line 849) | def generate_oai_reply( method _generate_code_execution_reply_using_executor (line 864) | def _generate_code_execution_reply_using_executor( method __generate_code_execution_reply_using_executor (line 880) | def __generate_code_execution_reply_using_executor( method confidence_level_guidelines (line 965) | def confidence_level_guidelines() -> str: method final_answer_guidelines (line 984) | def final_answer_guidelines() -> str: class H2OGroupChatManager (line 1005) | class H2OGroupChatManager(GroupChatManager): method _generate_oai_reply_from_client (line 1011) | def _generate_oai_reply_from_client(self, llm_client, messages, cache)... function terminate_message_func (line 1023) | def terminate_message_func(msg): function get_autogen_response (line 1037) | async def get_autogen_response(func=None, use_process=False, **kwargs): function get_code_executor (line 1055) | def get_code_executor( function merge_group_chat_messages (line 1110) | def merge_group_chat_messages(a, b): function get_all_conversable_agents (line 1146) | def get_all_conversable_agents(group_chat_manager: GroupChatManager) -> ... function get_autogen_use_planning_prompt (line 1159) | def get_autogen_use_planning_prompt(model: str) -> bool: FILE: openai_server/backend.py function start_faulthandler (line 24) | def start_faulthandler(): function decode (line 40) | def decode(x, encoding_name="cl100k_base"): function encode (line 49) | def encode(x, encoding_name="cl100k_base"): function count_tokens (line 58) | def count_tokens(x, encoding_name="cl100k_base"): function get_gradio_auth (line 67) | def get_gradio_auth(user=None, verbose=False): function get_gradio_client (line 119) | def get_gradio_client(user=None, verbose=False): function sanitize (line 152) | def sanitize(name): function get_client (line 159) | def get_client(user=None): function get_chunk (line 242) | def get_chunk(outputs_list, job_outputs_num, last_response, num, verbose... function get_response (line 260) | async def get_response(chunk_response=True, **kwargs): function split_concatenated_dicts (line 330) | def split_concatenated_dicts(concatenated_dicts: str): function get_generator (line 354) | def get_generator(instruction, gen_kwargs, use_agent=False, stream_outpu... function achat_completion_action (line 387) | async def achat_completion_action(body: dict, stream_output=False): function acompletions_action (line 530) | async def acompletions_action(body: dict, stream_output=False): function astream_chat_completions (line 654) | async def astream_chat_completions(body: dict, stream_output=True): function astream_completions (line 659) | async def astream_completions(body: dict, stream_output=True): function get_model_info (line 664) | def get_model_info(): function get_model_list (line 671) | def get_model_list(): function split_audio_on_silence (line 679) | def split_audio_on_silence(audio_bytes): function split_audio_fixed_intervals (line 695) | def split_audio_fixed_intervals(audio_bytes, interval_ms=10000): function audio_to_text (line 710) | async def audio_to_text(model, audio_file, stream, response_format, chun... function _audio_to_text (line 726) | async def _audio_to_text(model, audio_file, stream, response_format, chu... function text_to_audio (line 766) | async def text_to_audio(model, voice, input, stream, response_format, **... function audio_str_to_bytes (line 819) | def audio_str_to_bytes(audio_str1, response_format='wav'): function list_to_bytes (line 853) | def list_to_bytes(lst: list) -> str: function text_to_embedding (line 861) | def text_to_embedding(model, text, encoding_format, **kwargs): FILE: openai_server/backend_utils.py function concatenate_messages (line 8) | def concatenate_messages(messages, role="assistant", sep="\n"): function concat_tool_messages (line 29) | def concat_tool_messages(messages): function convert_messages_to_structure (line 93) | def convert_messages_to_structure( function handle_content (line 189) | def handle_content(content, structure): function structure_to_messages (line 218) | def structure_to_messages(instruction, system_message, history, image_fi... function convert_gen_kwargs (line 276) | def convert_gen_kwargs(gen_kwargs): function get_user_dir (line 333) | def get_user_dir(authorization): function run_upload_api (line 342) | def run_upload_api(content, filename, purpose, authorization, created_at... function run_download_api (line 370) | def run_download_api(file_id, authorization): function run_download_api_all (line 388) | def run_download_api_all(agent_files, authorization, agent_work_dir): function extract_xml_tags (line 397) | def extract_xml_tags(full_text, tags=['name', 'page']): function generate_unique_filename (line 407) | def generate_unique_filename(name_page_dict): function deduplicate_filenames (line 423) | def deduplicate_filenames(filenames): FILE: openai_server/chat_history_render.py function chat_to_pretty_markdown (line 8) | def chat_to_pretty_markdown( function wrap_long_lines (line 91) | def wrap_long_lines(line: str, max_width: int = 80) -> str: function chat_to_pretty_markdown_simple (line 113) | def chat_to_pretty_markdown_simple( FILE: openai_server/cogvlm2_server/cogvlm2.py function lifespan (line 35) | async def lifespan(app: FastAPI): class ModelCard (line 58) | class ModelCard(BaseModel): class ModelList (line 72) | class ModelList(BaseModel): class ImageUrl (line 77) | class ImageUrl(BaseModel): class TextContent (line 81) | class TextContent(BaseModel): class ImageUrlContent (line 86) | class ImageUrlContent(BaseModel): class ChatMessageInput (line 94) | class ChatMessageInput(BaseModel): class ChatMessageResponse (line 100) | class ChatMessageResponse(BaseModel): class DeltaMessage (line 106) | class DeltaMessage(BaseModel): class ChatCompletionRequest (line 111) | class ChatCompletionRequest(BaseModel): class ChatCompletionResponseChoice (line 122) | class ChatCompletionResponseChoice(BaseModel): class ChatCompletionResponseStreamChoice (line 127) | class ChatCompletionResponseStreamChoice(BaseModel): class UsageInfo (line 132) | class UsageInfo(BaseModel): class ChatCompletionResponse (line 138) | class ChatCompletionResponse(BaseModel): function health (line 147) | async def health() -> Response: function list_models (line 153) | async def list_models(): function create_chat_completion (line 163) | async def create_chat_completion(request: ChatCompletionRequest): function predict (line 206) | def predict(model_id: str, params: dict): function generate_cogvlm (line 232) | def generate_cogvlm(model: AutoModelForCausalLM, tokenizer: AutoTokenize... function process_history_and_images (line 245) | def process_history_and_images(messages: List[ChatMessageInput]) -> Tuple[ function generate_stream_cogvlm (line 308) | def generate_stream_cogvlm(model: AutoModelForCausalLM, tokenizer: AutoT... FILE: openai_server/openai_client.py class MyReturnType (line 27) | class MyReturnType(BaseModel): class Config (line 28) | class Config: class LangChainAction (line 33) | class LangChainAction(Enum): function get_files_from_ids (line 41) | def get_files_from_ids(usage=None, client=None, file_ids=None, work_dir=... function file_to_base64 (line 82) | def file_to_base64(file_path, file_path_to_use=None): function clean_text_string (line 99) | def clean_text_string(input_string): function local_convert_to_pdf (line 107) | def local_convert_to_pdf(convert_to_pdf, x, files_already_pdf, *args, **... function group_files_by_base_name (line 118) | def group_files_by_base_name(file_names): function group_and_prioritize_files (line 126) | def group_and_prioritize_files(file_names): function select_preferred_file (line 139) | def select_preferred_file(files): function get_pdf_files (line 149) | def get_pdf_files(file_names, convert_to_pdf): function completion_with_backoff (line 306) | def completion_with_backoff( function run_openai_client (line 451) | def run_openai_client( function is_binary (line 820) | def is_binary(filename): function update_file_names (line 848) | def update_file_names(file_list): function shutil_rmtree (line 861) | def shutil_rmtree(*args, **kwargs): function remove (line 872) | def remove(path: str): FILE: openai_server/server.py class Generation (line 41) | class Generation(BaseModel): class ResponseFormat (line 48) | class ResponseFormat(BaseModel): class H2oGPTParams (line 56) | class H2oGPTParams(BaseModel): class AgentParams (line 182) | class AgentParams(BaseModel): class Params (line 203) | class Params(H2oGPTParams, AgentParams): class CompletionParams (line 220) | class CompletionParams(Params): class TextRequest (line 226) | class TextRequest(Generation, CompletionParams): class TextResponse (line 230) | class TextResponse(BaseModel): class ChatParams (line 239) | class ChatParams(Params): class ChatRequest (line 245) | class ChatRequest(Generation, ChatParams): class ChatResponse (line 250) | class ChatResponse(BaseModel): class Model (line 259) | class Model(BaseModel): class ModelInfoResponse (line 266) | class ModelInfoResponse(BaseModel): class ModelListResponse (line 270) | class ModelListResponse(BaseModel): function verify_api_key (line 274) | def verify_api_key(authorization: str = Header(None)) -> None: function extract_model_from_request (line 310) | async def extract_model_from_request(request: Request, request_data: Cha... function model_rate_limit_key (line 319) | def model_rate_limit_key(request: Request): function api_key_rate_limit_key (line 332) | def api_key_rate_limit_key(request: Request): class InvalidRequestError (line 362) | class InvalidRequestError(Exception): function health (line 389) | async def health(request: Request) -> Response: function show_version (line 397) | async def show_version(request: Request): function validation_exception_handler (line 408) | async def validation_exception_handler(request, exc): function options_route (line 415) | async def options_route(): function openai_completions (line 423) | async def openai_completions(request: Request, request_data: TextRequest... function random_uuid (line 478) | def random_uuid() -> str: class FunctionCall (line 482) | class FunctionCall(BaseModel): class ToolCall (line 487) | class ToolCall(BaseModel): function get_tool (line 493) | async def get_tool(request: Request, request_data: ChatRequest, authoriz... function _get_tool (line 508) | async def _get_tool(request: Request, request_data: ChatRequest, authori... function tool_to_guided_json (line 593) | def tool_to_guided_json(tool): function openai_chat_completions (line 605) | async def openai_chat_completions(request: Request, function handle_models (line 721) | async def handle_models(request: Request): function handle_model_info (line 751) | async def handle_model_info(request: Request): function handle_list_models (line 759) | async def handle_list_models(request: Request): class AudiotoTextRequest (line 765) | class AudiotoTextRequest(BaseModel): function handle_audio_transcription (line 777) | async def handle_audio_transcription(request: Request): class AudioTextRequest (line 835) | class AudioTextRequest(BaseModel): function modify_wav_header (line 846) | def modify_wav_header(wav_bytes): function handle_audio_to_speech (line 880) | async def handle_audio_to_speech(request: Request): class ImageGenerationRequest (line 935) | class ImageGenerationRequest(BaseModel): function handle_image_generation (line 949) | async def handle_image_generation(request: Request): class EmbeddingsResponse (line 1000) | class EmbeddingsResponse(BaseModel): class EmbeddingsRequest (line 1006) | class EmbeddingsRequest(BaseModel): function handle_embeddings (line 1016) | async def handle_embeddings(request: Request, request_data: EmbeddingsRe... class UploadFileResponse (line 1044) | class UploadFileResponse(BaseModel): function upload_file (line 1056) | async def upload_file( class FileData (line 1070) | class FileData(BaseModel): class ListFilesResponse (line 1079) | class ListFilesResponse(BaseModel): function list_files (line 1086) | async def list_files(request: Request, authorization: str = Header(None)): class RetrieveFileResponse (line 1126) | class RetrieveFileResponse(BaseModel): function retrieve_file (line 1138) | async def retrieve_file(request: Request, file_id: str, authorization: s... class DeleteFileResponse (line 1165) | class DeleteFileResponse(BaseModel): function delete_file (line 1174) | async def delete_file(request: Request, file_id: str, authorization: str... function retrieve_file_content (line 1199) | async def retrieve_file_content(request: Request, file_id: str, stream: ... FILE: openai_server/server_start.py function run_server (line 23) | def run_server(host: str = '0.0.0.0', function run (line 149) | def run(wait=True, **kwargs): function argv_to_kwargs (line 213) | def argv_to_kwargs(argv=None): FILE: openai_server/test_autogen_utils.py function test_shell_safe_commands (line 10) | def test_shell_safe_commands(): function test_shell_dangerous_commands (line 17) | def test_shell_dangerous_commands(): function test_shell_comments_and_strings (line 32) | def test_shell_comments_and_strings(): function test_shell_background_and_scheduling (line 37) | def test_shell_background_and_scheduling(): function test_shell_file_operations (line 44) | def test_shell_file_operations(): function test_shell_network_operations (line 51) | def test_shell_network_operations(): function test_shell_command_substitution (line 58) | def test_shell_command_substitution(): function test_python_safe_operations (line 72) | def test_python_safe_operations(): function test_python_dangerous_operations (line 79) | def test_python_dangerous_operations(): function test_python_subprocess_and_system (line 88) | def test_python_subprocess_and_system(): function test_python_comments_and_strings (line 96) | def test_python_comments_and_strings(): function test_python_network_operations (line 103) | def test_python_network_operations(): function test_python_system_operations (line 116) | def test_python_system_operations(): function test_remove_comments_strings_shell (line 124) | def test_remove_comments_strings_shell(): function test_remove_comments_strings_python (line 131) | def test_remove_comments_strings_python(): function test_edge_cases (line 138) | def test_edge_cases(): function test_complex_commands (line 144) | def test_complex_commands(): function test_shell_path_traversal (line 151) | def test_shell_path_traversal(): function test_python_eval_variations (line 158) | def test_python_eval_variations(): function test_complex_imports (line 163) | def test_complex_imports(): function test_nested_function_calls (line 176) | def test_nested_function_calls(): function test_multi_line_commands (line 184) | def test_multi_line_commands(): function test_ctypes_import (line 190) | def test_ctypes_import(): function setup_env_vars (line 208) | def setup_env_vars(): function test_output_guardrail_safe_output (line 220) | def test_output_guardrail_safe_output(setup_env_vars): function test_output_guardrail_key_name_in_output (line 225) | def test_output_guardrail_key_name_in_output(setup_env_vars): function test_output_guardrail_dummy_value_in_output (line 230) | def test_output_guardrail_dummy_value_in_output(setup_env_vars): function test_output_guardrail_real_key_in_output (line 235) | def test_output_guardrail_real_key_in_output(setup_env_vars): function test_output_guardrail_multiple_keys_in_output (line 241) | def test_output_guardrail_multiple_keys_in_output(setup_env_vars): function test_output_guardrail_partial_key_in_output (line 250) | def test_output_guardrail_partial_key_in_output(setup_env_vars): function test_output_guardrail_empty_output (line 255) | def test_output_guardrail_empty_output(): function test_output_guardrail_non_string_output (line 260) | def test_output_guardrail_non_string_output(): function test_output_guardrail_allowed_values (line 276) | def test_output_guardrail_allowed_values(allowed_value): function test_output_guardrail1 (line 281) | def test_output_guardrail1(): function workspace_path (line 390) | def workspace_path(): function test_basic_filename_extraction (line 394) | def test_basic_filename_extraction(workspace_path): function test_filename_with_path (line 399) | def test_filename_with_path(workspace_path): function test_filename_with_different_comment_styles (line 404) | def test_filename_with_different_comment_styles(workspace_path): function test_filename_not_on_first_line (line 413) | def test_filename_not_on_first_line(workspace_path): function test_no_filename_specified (line 418) | def test_no_filename_specified(workspace_path): function test_invalid_filename (line 423) | def test_invalid_filename(workspace_path): function test_filename_outside_workspace (line 428) | def test_filename_outside_workspace(workspace_path): function test_filename_with_colon (line 433) | def test_filename_with_colon(workspace_path): function test_filename_without_colon (line 438) | def test_filename_without_colon(workspace_path): function test_multiple_filenames (line 443) | def test_multiple_filenames(workspace_path): function test_commented_out_filename (line 448) | def test_commented_out_filename(workspace_path): function test_filename_with_spaces_around (line 453) | def test_filename_with_spaces_around(workspace_path): function test_filename_with_extension_containing_dot (line 458) | def test_filename_with_extension_containing_dot(workspace_path): FILE: openai_server/test_backend_utils.py function test_extract_xml_tags (line 4) | def test_extract_xml_tags(): function test_deduplicate_filenames (line 24) | def test_deduplicate_filenames(): function test_generate_unique_filename_multiple_returns (line 46) | def test_generate_unique_filename_multiple_returns(): function test_exif (line 82) | def test_exif(): FILE: openai_server/test_conversion.py function test_conversion (line 13) | def test_conversion(): function test_conversion2 (line 89) | def test_conversion2(): function test_structure_to_messages (line 169) | def test_structure_to_messages(): function test_structure_to_messages_with_system_message (line 207) | def test_structure_to_messages_with_system_message(): function test_convert_messages_to_structure (line 226) | def test_convert_messages_to_structure(): function test_image_download (line 325) | def test_image_download(): function test_concat (line 335) | def test_concat(): function test_concat_tool (line 371) | def test_concat_tool(): function test_concat_tool_messages (line 569) | def test_concat_tool_messages(messages: List[Dict[str, str]], expected: ... function test_split_single_dict (line 574) | def test_split_single_dict(): function test_split_multiple_simple_dicts (line 580) | def test_split_multiple_simple_dicts(): function test_split_multiple_complex_dicts (line 586) | def test_split_multiple_complex_dicts(): function test_split_dicts_with_nested_braces (line 592) | def test_split_dicts_with_nested_braces(): function test_split_empty_dicts (line 598) | def test_split_empty_dicts(): function test_split_mixed_empty_and_non_empty_dicts (line 604) | def test_split_mixed_empty_and_non_empty_dicts(): function test_split_whitespace_between_dicts (line 610) | def test_split_whitespace_between_dicts(): function test_split_invalid_input (line 616) | def test_split_invalid_input(): function test_split_empty_input (line 621) | def test_split_empty_input(): function test_split_single_dict_with_whitespace (line 625) | def test_split_single_dict_with_whitespace(): function test_split_dicts_with_escaped_quotes (line 631) | def test_split_dicts_with_escaped_quotes(): FILE: openai_server/test_openai_server.py function launch_openai_server (line 16) | def launch_openai_server(): function test_openai_server (line 22) | def test_openai_server(): function test_openai_client_test2 (line 41) | def test_openai_client_test2(stream_output, chat, local_server): function test_openai_client (line 61) | def test_openai_client(stream_output, chat, local_server, openai_workers... function run_openai_client (line 67) | def run_openai_client(stream_output, chat, local_server, openai_workers,... function run_test_chat (line 135) | def run_test_chat(chat, openai_client, async_client, system_prompt, chat... function show_plot_from_ids (line 196) | def show_plot_from_ids(usage, client): function test_autogen (line 233) | def test_autogen(): function text_file (line 339) | def text_file(): function pdf_file (line 354) | def pdf_file(): function image_file (line 367) | def image_file(): function python_file (line 380) | def python_file(): function video_file (line 392) | def video_file(): function test_file_operations (line 405) | def test_file_operations(request, test_file): function check_content (line 469) | def check_content(content, test_file_type, test_file): function test_return_generator (line 527) | def test_return_generator(): function test_tool_use (line 552) | def test_tool_use(): function test_tool_use2 (line 648) | def test_tool_use2(): FILE: openai_server/test_prompt_caching.py function assert_cache_control_count (line 16) | def assert_cache_control_count(messages: List[Dict], expected_count: int): function test_simple_string_messages (line 25) | def test_simple_string_messages(): function test_mixed_content_types (line 41) | def test_mixed_content_types(): function test_max_cache_control_limit (line 57) | def test_max_cache_control_limit(): function test_empty_list_content (line 71) | def test_empty_list_content(): function test_preserve_message_order (line 82) | def test_preserve_message_order(): FILE: setup.py function parse_requirements (line 10) | def parse_requirements(file_name: str) -> List[str]: FILE: spaces/demo/app.py function generate (line 25) | def generate(query): function process_example (line 40) | def process_example(args): FILE: spaces/demo/app_client_test.py function test_app_client_basic (line 28) | def test_app_client_basic(): function md_to_text (line 40) | def md_to_text(md): FILE: src/audio_langchain.py class OpenAIWhisperParser (line 16) | class OpenAIWhisperParser(BaseBlobParser): method __init__ (line 20) | def __init__(self, api_key: Optional[str] = None): method lazy_parse (line 23) | def lazy_parse(self, blob: Blob) -> Iterator[Document]: class OpenAIWhisperParserLocal (line 85) | class OpenAIWhisperParserLocal(BaseBlobParser): method __init__ (line 108) | def __init__( method lazy_parse (line 231) | def lazy_parse(self, blob: Blob) -> Iterator[Document]: class H2OAudioCaptionLoader (line 308) | class H2OAudioCaptionLoader(ImageCaptionLoader): method __init__ (line 311) | def __init__(self, path_audios: Union[str, List[str]] = None, method set_context (line 332) | def set_context(self): method load_model (line 353) | def load_model(self): method set_audio_paths (line 379) | def set_audio_paths(self, path_audios: Union[str, List[str]]): method load (line 388) | def load(self, from_youtube=False) -> List[Document]: method unload_model (line 411) | def unload_model(self): class YoutubeAudioLoader (line 423) | class YoutubeAudioLoader(BlobLoader): method __init__ (line 427) | def __init__(self, urls: List[str], save_dir: str): method yield_blobs (line 435) | def yield_blobs(self) -> Iterable[Blob]: FILE: src/cli.py function run_cli (line 10) | def run_cli( # for local function: FILE: src/client_test.py function get_client (line 65) | def get_client(serialize=not is_gradio_version4): function get_args (line 74) | def get_args(prompt, prompt_type=None, chat=False, function test_client_basic (line 236) | def test_client_basic(prompt_type='human_bot', version=None, visible_mod... function test_client_basic_benchmark (line 250) | def test_client_basic_benchmark(id, prompt_type='human_bot', version=None): function run_client_nochat (line 296) | def run_client_nochat(prompt, prompt_type, max_new_tokens, version=None,... function test_client_basic_api (line 314) | def test_client_basic_api(prompt_type='human_bot', version=None, h2ogpt_... function run_client_nochat_api (line 319) | def run_client_nochat_api(prompt, prompt_type, max_new_tokens, version=N... function test_client_basic_api_lean (line 338) | def test_client_basic_api_lean(prompt='Who are you?', prompt_type='human... function run_client_nochat_api_lean (line 346) | def run_client_nochat_api_lean(prompt, prompt_type, max_new_tokens, vers... function test_client_basic_api_lean_morestuff (line 367) | def test_client_basic_api_lean_morestuff(prompt_type='human_bot', versio... function run_client_nochat_api_lean_morestuff (line 372) | def run_client_nochat_api_lean_morestuff(prompt, prompt_type='human_bot'... function test_client_chat (line 427) | def test_client_chat(prompt_type='human_bot', version=None, h2ogpt_key=N... function test_client_chat_stream (line 437) | def test_client_chat_stream(prompt_type='human_bot', version=None, h2ogp... function run_client_chat (line 447) | def run_client_chat(prompt='', function run_client (line 496) | def run_client(client, prompt, args, kwargs, do_md_to_text=True, verbose... function test_client_nochat_stream (line 543) | def test_client_nochat_stream(prompt_type='human_bot', version=None, h2o... function run_client_nochat_gen (line 553) | def run_client_nochat_gen(prompt, prompt_type, stream_output, max_new_to... function run_client_gen (line 565) | def run_client_gen(client, kwargs, do_md_to_text=True): function md_to_text (line 592) | def md_to_text(md, do_md_to_text=True): function run_client_many (line 601) | def run_client_many(prompt_type='human_bot', version=None, h2ogpt_key=No... FILE: src/create_data.py function parse_rst_file (line 29) | def parse_rst_file(filepath): function test_scrape_dai_docs (line 60) | def test_scrape_dai_docs(): function test_scrape_dai_docs_all (line 73) | def test_scrape_dai_docs_all(): function get_sentences (line 111) | def get_sentences(blob, length): function setup_dai_docs (line 136) | def setup_dai_docs(path=None, dst="working_dir_docs", from_hf=False): function rst_to_outputs (line 187) | def rst_to_outputs(files, min_len=30, max_len=2048 // 2 - 30): function test_scrape_dai_docs_all_pandoc (line 255) | def test_scrape_dai_docs_all_pandoc(): function test_config_to_json (line 277) | def test_config_to_json(): function copy_tree (line 353) | def copy_tree(src, dst, follow_symlink=False): function atomic_move (line 368) | def atomic_move(src, dst): function atomic_copy (line 376) | def atomic_copy(src=None, dst=None, with_permissions=True): function makedirs (line 391) | def makedirs(path, exist_ok=True): function test_prep_instruct_vicuna (line 406) | def test_prep_instruct_vicuna(): function test_get_small_sample_oig_data (line 500) | def test_get_small_sample_oig_data(filename): function test_download_useful_data_as_parquet (line 514) | def test_download_useful_data_as_parquet(filename): function test_merge_shuffle_small_sample_oig_data (line 525) | def test_merge_shuffle_small_sample_oig_data(): function test_join_jsons (line 536) | def test_join_jsons(): function test_make_rlhf_good_data (line 548) | def test_make_rlhf_good_data(filename): function test_show_prompts (line 562) | def test_show_prompts(): function test_get_open_datasets (line 573) | def test_get_open_datasets(): function do_one (line 762) | def do_one(data_id, num_downloads): function test_otherlic (line 805) | def test_otherlic(): function test_assemble_and_detox (line 933) | def test_assemble_and_detox(): function test_basic_cleaning (line 983) | def test_basic_cleaning(): function parallel_apply (line 1029) | def parallel_apply(df, func, n_jobs=-1, **kwargs): function add_better_profanity_flag (line 1053) | def add_better_profanity_flag(df): function add_textstat_grade (line 1063) | def add_textstat_grade(df): function add_deberta_grade (line 1081) | def add_deberta_grade(df): function test_chop_by_lengths (line 1156) | def test_chop_by_lengths(): function count_human_bot_lengths (line 1180) | def count_human_bot_lengths(df, human=None, bot=None): function test_grade (line 1230) | def test_grade(): function test_add_open_assistant (line 1296) | def test_add_open_assistant(fixup_personality, only_personality, deberta... function test_finalize_to_json (line 1493) | def test_finalize_to_json(): function create_personality_data (line 1539) | def create_personality_data(prompt_type="llama2"): function test_check_stats_data (line 1589) | def test_check_stats_data(): function get_unhelpful_list (line 1644) | def get_unhelpful_list(): function test_check_unhelpful (line 1745) | def test_check_unhelpful(): function test_fortune2000_personalized (line 1825) | def test_fortune2000_personalized(): FILE: src/db_utils.py function set_userid (line 9) | def set_userid(db1s, requests_state1, get_userid_auth, guest_name=''): function set_userid_direct (line 25) | def set_userid_direct(db1s, userid, username): function get_userid_direct (line 31) | def get_userid_direct(db1s): function get_username_direct (line 35) | def get_username_direct(db1s): function get_dbid (line 39) | def get_dbid(db1): function set_dbid (line 43) | def set_dbid(db1): function length_db1 (line 51) | def length_db1(): function create_table (line 64) | def create_table(auth_filename): function fetch_user (line 79) | def fetch_user(auth_filename, username, verbose=False): function upsert_user (line 133) | def upsert_user(db_filename, username, user_details, verbose=False): function upsert_auth_dict (line 162) | def upsert_auth_dict(db_filename, auth_dict, verbose=False): function get_all_usernames (line 192) | def get_all_usernames(auth_filename): function merge_dicts (line 211) | def merge_dicts(original, updates): function append_to_users_data (line 229) | def append_to_users_data(auth_filename, updates, verbose=False): function append_to_user_data (line 271) | def append_to_user_data(auth_filename, username, updates, verbose=False): FILE: src/enums.py class PromptType (line 4) | class PromptType(Enum): class DocumentSubset (line 83) | class DocumentSubset(Enum): class DocumentChoice (line 95) | class DocumentChoice(Enum): class LangChainMode (line 99) | class LangChainMode(Enum): class LangChainTypes (line 112) | class LangChainTypes(Enum): class LangChainAction (line 127) | class LangChainAction(Enum): class LangChainAgent (line 156) | class LangChainAgent(Enum): function is_gradio_vision_model (line 431) | def is_gradio_vision_model(base_model): function is_vision_model (line 440) | def is_vision_model(base_model, all_visible_models=[], visible_vision_mo... function extra_stop_token_ids (line 470) | def extra_stop_token_ids(base_model, tokenizer=None, as_ids=False): function tokens_per_image (line 490) | def tokens_per_image(base_model): function is_video_model (line 526) | def is_video_model(base_model): function is_json_model (line 532) | def is_json_model(base_model, inference_server, json_vllm=False): function does_support_functiontools (line 567) | def does_support_functiontools(inference_server, model_name): function does_support_json_mode (line 585) | def does_support_json_mode(inference_server, model_name, json_vllm=False): function t5_type (line 607) | def t5_type(model_name): function get_langchain_prompts (line 615) | def get_langchain_prompts(pre_prompt_query, prompt_query, pre_prompt_sum... function gr_to_lg (line 644) | def gr_to_lg(image_audio_loaders, FILE: src/eval.py function run_eval (line 13) | def run_eval( # for local function: FILE: src/export_hf_checkpoint.py function do_export (line 13) | def do_export(): function do_copy (line 220) | def do_copy(OUTPUT_NAME): function test_copy (line 236) | def test_copy(): function inner_test_copy (line 248) | def inner_test_copy(): FILE: src/function_client.py function execute_function_on_server (line 8) | def execute_function_on_server(host: str, port: int, function_name: str,... function read_result_from_disk (line 28) | def read_result_from_disk(file_path: str, use_pickle: bool, verbose=False): function call_function_server (line 48) | def call_function_server(host, port, function_name, args, kwargs, use_di... function get_data_h2ogpt (line 63) | def get_data_h2ogpt(file_path, verbose=False, is_url=False, **kwargs): FILE: src/function_server.py function verify_api_key (line 31) | def verify_api_key(authorization: str = Header(None)) -> None: class InvalidRequestError (line 52) | class InvalidRequestError(Exception): class FunctionRequest (line 56) | class FunctionRequest(BaseModel): function health (line 65) | async def health() -> Response: function validation_exception_handler (line 71) | async def validation_exception_handler(request, exc): function options_route (line 78) | async def options_route(): function initialize_gen_kwargs (line 86) | def initialize_gen_kwargs(): function execute_function (line 127) | def execute_function(request: FunctionRequest): function do_check (line 173) | def do_check(in_finally=False): function startup_event (line 184) | async def startup_event(verbose=True): function periodic_health_check (line 188) | async def periodic_health_check(verbose=False): function check_some_conditions (line 196) | def check_some_conditions(): FILE: src/gen.py function main (line 113) | def main( function evaluate_fake (line 2443) | def evaluate_fake(*args, **kwargs): function evaluate (line 2456) | def evaluate( function get_cutoffs (line 4393) | def get_cutoffs(memory_restriction_level, for_context=False, model_max_l... class H2OTextIteratorStreamer (line 4414) | class H2OTextIteratorStreamer(TextIteratorStreamer): method __init__ (line 4420) | def __init__(self, tokenizer, skip_prompt: bool = False, timeout: typi... method on_finalized_text (line 4429) | def on_finalized_text(self, text: str, stream_end: bool = False): method __iter__ (line 4435) | def __iter__(self): method __next__ (line 4438) | def __next__(self): method clear_queue (line 4460) | def clear_queue(self): method put (line 4465) | def put(self, value): function generate_with_exceptions (line 4504) | def generate_with_exceptions(func, *args, raise_generate_gpu_exceptions=... function get_generate_params (line 4537) | def get_generate_params(model_lower, function languages_covered (line 4895) | def languages_covered(): function score_qa (line 4903) | def score_qa(smodel, stokenizer, question, answer, memory_restriction_le... function check_locals (line 4947) | def check_locals(**kwargs): function get_model_max_length (line 4970) | def get_model_max_length(model_state): function get_model_max_length_from_tokenizer (line 4977) | def get_model_max_length_from_tokenizer(tokenizer): function get_max_max_new_tokens (line 4984) | def get_max_max_new_tokens(model_state, **kwargs): function get_minmax_top_k_docs (line 5015) | def get_minmax_top_k_docs(is_public, from_ui): function remove_refs (line 5030) | def remove_refs(text, keep_sources_in_context, langchain_mode, hyde_leve... function history_to_context (line 5058) | def history_to_context(history, langchain_mode=None, function get_relaxed_max_new_tokens (line 5179) | def get_relaxed_max_new_tokens(prompt, tokenizer=None, max_new_tokens=No... function get_limited_prompt (line 5192) | def get_limited_prompt(instruction, function count_overhead_tokens (line 5574) | def count_overhead_tokens(tokenizer, doing_grounding=False): function entrypoint_main (line 5596) | def entrypoint_main(): function append_certificates (line 5629) | def append_certificates(certs_dir): FILE: src/gpt4all_llm.py function get_model_tokenizer_gpt4all (line 16) | def get_model_tokenizer_gpt4all(base_model, n_jobs=None, gpu_id=None, n_... class H2OStreamingStdOutCallbackHandler (line 52) | class H2OStreamingStdOutCallbackHandler(StreamingStdOutCallbackHandler): method on_llm_new_token (line 54) | def on_llm_new_token(self, token: str, **kwargs: Any) -> None: function get_model_kwargs (line 62) | def get_model_kwargs(llamacpp_dict, default_kwargs, cls, exclude_list=[]): function get_gpt4all_default_kwargs (line 84) | def get_gpt4all_default_kwargs(max_new_tokens=256, function get_llm_gpt4all (line 121) | def get_llm_gpt4all(model_name=None, class H2OGPT4All (line 279) | class H2OGPT4All(gpt4all.GPT4All): method validate_environment (line 290) | def validate_environment(cls, values: Dict) -> Dict: method _call (line 327) | def _call( class H2OLlamaCpp (line 359) | class H2OLlamaCpp(LlamaCpp): method validate_environment (line 375) | def validate_environment(cls, values: Dict) -> Dict: method _call (line 425) | def _call( method remove_stop_text (line 482) | def remove_stop_text(self, text, stop=None): method _stream (line 491) | def _stream( method get_token_ids (line 511) | def get_token_ids(self, text: str) -> List[int]: FILE: src/gpt_langchain.py function get_context_cast (line 131) | def get_context_cast(): function get_db (line 137) | def get_db(sources, use_openai_embedding=False, db_type='faiss', function _get_unique_sources_in_weaviate (line 261) | def _get_unique_sources_in_weaviate(db): function del_from_db (line 275) | def del_from_db(db, sources, db_type=None): function add_to_db (line 312) | def add_to_db(db, sources, db_type='faiss', function create_or_update_db (line 422) | def create_or_update_db(db_type, persist_directory, collection_name, class H2OFakeEmbeddings (line 493) | class H2OFakeEmbeddings(FakeEmbeddings): method _get_embedding (line 499) | def _get_embedding(self) -> typing.List[float]: method embed_documents (line 502) | def embed_documents(self, texts: typing.List[str]) -> typing.List[typi... method embed_query (line 505) | def embed_query(self, text: str) -> typing.List[float]: function get_embedding (line 509) | def get_embedding(use_openai_embedding, hf_embedding_model=None, preload... function get_answer_from_sources (line 578) | def get_answer_from_sources(chain, sources, question): class H2Oagenerate (line 598) | class H2Oagenerate: method _agenerate (line 599) | async def _agenerate( method _agenerate_one (line 628) | async def _agenerate_one( class AGenerateStreamFirst (line 643) | class AGenerateStreamFirst: method agenerate (line 646) | async def agenerate( class ChatAGenerateStreamFirst (line 803) | class ChatAGenerateStreamFirst: method agenerate (line 806) | async def agenerate( class GradioInference (line 911) | class GradioInference(AGenerateStreamFirst, H2Oagenerate, LLM): method validate_environment (line 997) | def validate_environment(cls, values: Dict) -> Dict: method _llm_type (line 1014) | def _llm_type(self) -> str: method setup_call (line 1018) | def setup_call(self, prompt): method _call (line 1159) | def _call( method use_gradio_return (line 1277) | def use_gradio_return(self, res_dict, prompt_raw): method _acall (line 1284) | async def _acall( method get_token_ids (line 1373) | def get_token_ids(self, text: str) -> List[int]: class GradioLLaVaInference (line 1379) | class GradioLLaVaInference(GradioInference): method validate_environment (line 1386) | def validate_environment(cls, values: Dict) -> Dict: method _llm_type (line 1403) | def _llm_type(self) -> str: method setup_call (line 1407) | def setup_call(self, prompt): method _call (line 1456) | def _call( method _acall (line 1511) | async def _acall( class SGlangInference (line 1558) | class SGlangInference(AGenerateStreamFirst, H2Oagenerate, LLM): method validate_environment (line 1618) | def validate_environment(cls, values: Dict) -> Dict: method _llm_type (line 1631) | def _llm_type(self) -> str: method get_token_ids (line 1635) | def get_token_ids(self, text: str) -> List[int]: method get_conv_template (line 1641) | def get_conv_template(conv_template_name): method send_request (line 1647) | async def send_request(self, url, data, delay=0, timeout=None): method setup_call (line 1667) | def setup_call(self, prompt): method do_many (line 1731) | def do_many(self): method a_do_many (line 1736) | async def a_do_many(self): method many_to_prompt (line 1739) | def many_to_prompt(self, prompt, responses): method do_final (line 1756) | def do_final(self): method get_many (line 1763) | async def get_many(self, url, pload): method _call (line 1776) | def _call( method _acall (line 1838) | async def _acall( class H2OHuggingFaceTextGenInference (line 1900) | class H2OHuggingFaceTextGenInference(AGenerateStreamFirst, H2Oagenerate,... method prep_prompt (line 1942) | def prep_prompt(self, prompt, stop, kwargs): method _call (line 1992) | def _call( method _acall (line 2044) | async def _acall( method get_token_ids (line 2067) | def get_token_ids(self, text: str) -> List[int]: class H2OTextGenOpenAI (line 2079) | class H2OTextGenOpenAI: method update_prompts_and_stops (line 2080) | def update_prompts_and_stops(self, prompts, stop, **kwargs): method update_kwargs (line 2105) | def update_kwargs(self, prompts, kwargs): method max_tokens_for_prompt (line 2115) | def max_tokens_for_prompt(self, prompt: str) -> int: method count_out_tokens (line 2123) | def count_out_tokens(self, rets): method collect_llm_results (line 2132) | def collect_llm_results(self, rets): method _generate (line 2149) | def _generate( method _stream (line 2188) | def _stream( method _astream (line 2198) | async def _astream( method _agenerate (line 2209) | async def _agenerate( method _agenerate_one (line 2242) | async def _agenerate_one( method get_token_ids (line 2256) | def get_token_ids(self, text: str) -> List[int]: class H2OOpenAI (line 2264) | class H2OOpenAI(H2OTextGenOpenAI, OpenAI): class H2OReplicate (line 2289) | class H2OReplicate(Replicate): method _call (line 2300) | def _call( class ExtraChat (line 2329) | class ExtraChat: method get_token_ids (line 2330) | def get_token_ids(self, text: str) -> List[int]: method get_messages (line 2342) | def get_messages(self, prompts): method get_num_tokens (line 2455) | def get_num_tokens(self, text: str) -> int: class GenerateStream (line 2465) | class GenerateStream: method get_count_output_tokens (line 2466) | def get_count_output_tokens(self, ret): method generate_prompt (line 2477) | def generate_prompt( method agenerate_prompt (line 2501) | async def agenerate_prompt( method _generate (line 2519) | def _generate( method tool_string_return (line 2553) | def tool_string_return(self, ret, have_tool): method _agenerate (line 2587) | async def _agenerate( class GenerateNormal (line 2612) | class GenerateNormal: method get_count_output_tokens (line 2613) | def get_count_output_tokens(self, ret): method generate_prompt (line 2624) | def generate_prompt( method agenerate_prompt (line 2638) | async def agenerate_prompt( class GenerateStream2 (line 2655) | class GenerateStream2: method count_out_tokens (line 2656) | def count_out_tokens(self, rets): method pre_generate (line 2667) | def pre_generate(self, prompts): method generate_prompt (line 2675) | def generate_prompt( method agenerate_prompt (line 2704) | async def agenerate_prompt( class H2OChatOpenAI (line 2738) | class H2OChatOpenAI(ChatAGenerateStreamFirst, GenerateStream, ExtraChat,... method get_token_ids (line 2751) | def get_token_ids(self, text: str) -> List[int]: class H2OAzureChatOpenAI (line 2759) | class H2OAzureChatOpenAI(ChatAGenerateStreamFirst, GenerateNormal, Extra... method get_token_ids (line 2770) | def get_token_ids(self, text: str) -> List[int]: class H2OChatAnthropic2 (line 2781) | class H2OChatAnthropic2(ChatAGenerateStreamFirst, GenerateNormal, ExtraC... class H2OChatAnthropic2Sys (line 2797) | class H2OChatAnthropic2Sys(H2OChatAnthropic2): class H2OChatAnthropic3 (line 2801) | class H2OChatAnthropic3(ChatAGenerateStreamFirst, GenerateStream, ExtraC... method process_messages (line 2817) | def process_messages(messages, max_cache_controls=3): method _get_request_payload (line 2855) | def _get_request_payload( method _stream (line 2884) | def _stream( class H2OChatAnthropic3Sys (line 2926) | class H2OChatAnthropic3Sys(H2OChatAnthropic3): class H2OChatGoogle (line 2938) | class H2OChatGoogle(ChatAGenerateStreamFirst, GenerateStream, ExtraChat,... class H2OChatMistralAI (line 2952) | class H2OChatMistralAI(ChatAGenerateStreamFirst, GenerateStream2, ExtraC... class H2OChatGroq (line 2967) | class H2OChatGroq(ChatAGenerateStreamFirst, GenerateStream2, ExtraChat, ... class H2OAzureOpenAI (line 2980) | class H2OAzureOpenAI(H2OTextGenOpenAI, AzureOpenAI): class H2OHuggingFacePipeline (line 2995) | class H2OHuggingFacePipeline(HuggingFacePipeline): method _generate (line 3000) | def _generate( method _call (line 3018) | def _call( method get_token_ids (line 3047) | def get_token_ids(self, text: str) -> List[int]: function get_llm (line 3055) | def get_llm(use_openai_model=False, function get_device_dtype (line 4193) | def get_device_dtype(): function get_wiki_data (line 4205) | def get_wiki_data(title, first_paragraph_only, text_limit=None, take_hea... function get_wiki_sources (line 4234) | def get_wiki_sources(first_para=True, text_limit=None): function get_github_docs (line 4246) | def get_github_docs(repo_owner, repo_name): function get_dai_pickle (line 4275) | def get_dai_pickle(dest="."): function get_dai_docs (line 4283) | def get_dai_docs(from_hf=False, get_pickle=True): function get_supported_types (line 4328) | def get_supported_types(): function try_as_html (line 4371) | def try_as_html(file): function json_metadata_func (line 4388) | def json_metadata_func(record: dict, metadata: dict) -> dict: function get_num_pages (line 4403) | def get_num_pages(file): function get_each_page (line 4412) | def get_each_page(file): class Crawler (line 4431) | class Crawler: method __init__ (line 4437) | def __init__(self, urls=[], deeper_only=True, depth=int(os.getenv('CRA... method download_url (line 4446) | def download_url(self, url): method get_linked_urls (line 4449) | def get_linked_urls(self, url, html): method add_url_to_visit (line 4460) | def add_url_to_visit(self, url): method crawl (line 4472) | def crawl(self, url): method run (line 4477) | def run(self): function file_to_doc (line 4499) | def file_to_doc(file, function path_to_doc1 (line 5566) | def path_to_doc1(file, function path_to_docs (line 5711) | def path_to_docs(path_or_paths, function prep_langchain (line 5988) | def prep_langchain(persist_directory, class FakeConsumer (line 6048) | class FakeConsumer(object): method __init__ (line 6049) | def __init__(self, *args, **kwargs): method run (line 6052) | def run(self): method pause (line 6055) | def pause(self): method upload (line 6058) | def upload(self): method next (line 6061) | def next(self): method request (line 6064) | def request(self, batch): function get_hf_embedding_model_name (line 6071) | def get_hf_embedding_model_name(hf_embedding_model): function check_update_chroma_embedding (line 6078) | def check_update_chroma_embedding(db, function migrate_meta_func (line 6121) | def migrate_meta_func(db, langchain_mode): function get_existing_db (line 6157) | def get_existing_db(db, persist_directory, function clear_embedding (line 6273) | def clear_embedding(db): function make_db (line 6287) | def make_db(**langchain_kwargs): function get_embed_lock_file (line 6305) | def get_embed_lock_file(db, persist_directory=None): function save_embed (line 6318) | def save_embed(db, use_openai_embedding, hf_embedding_model): function load_embed (line 6340) | def load_embed(db=None, persist_directory=None, use_openai_embedding=Fal... function sanitize_path_segment (line 6379) | def sanitize_path_segment(segment): function get_persist_directory (line 6384) | def get_persist_directory(langchain_mode, langchain_type=None, db1s=None... function check_persist_directory (line 6460) | def check_persist_directory(persist_directory): function _make_db (line 6467) | def _make_db(use_openai_embedding=False, function is_chroma_db (line 6682) | def is_chroma_db(db): function is_new_chroma_db (line 6686) | def is_new_chroma_db(db): function sim_search (line 6693) | def sim_search(db, query='', k=1000, with_score=False, filter_kwargs=Non... function _sim_search (line 6721) | def _sim_search(db, query='', k=1000, with_score=False, filter_kwargs=None, function large_chroma_db (line 6763) | def large_chroma_db(db): function get_metadatas (line 6767) | def get_metadatas(db, full_required=True, k_max=10000): function get_db_lock_file (line 6807) | def get_db_lock_file(db, lock_type='getdb'): function get_documents (line 6819) | def get_documents(db): function get_docs_and_meta (line 6857) | def get_docs_and_meta(db, top_k_docs, filter_kwargs={}, text_context_lis... function get_existing_files (line 6899) | def get_existing_files(db): function get_existing_hash_ids (line 6906) | def get_existing_hash_ids(db): function run_qa_db (line 6913) | def run_qa_db(**kwargs): function _run_qa_db (line 6963) | def _run_qa_db(query=None, function run_target (line 7619) | def run_target(query='', function get_docs_with_score (line 7788) | def get_docs_with_score(query, k_db, function _get_docs_with_score (line 7813) | def _get_docs_with_score(query, k_db, function get_single_document (line 7861) | def get_single_document(document_choice, db, extension=None): function run_hyde (line 7885) | def run_hyde(*args, **kwargs): function get_chain (line 8021) | def get_chain(query=None, function get_model_max_length (line 9284) | def get_model_max_length(llm=None, tokenizer=None, inference_server=None... function get_max_input_tokens (line 9298) | def get_max_input_tokens(llm=None, tokenizer=None, inference_server=None... function get_tokenizer (line 9317) | def get_tokenizer(db=None, llm=None, tokenizer=None, inference_server=No... function escape_braces (line 9346) | def escape_braces(text): function get_template (line 9353) | def get_template(query, iinput, function get_hyde_acc (line 9469) | def get_hyde_acc(answer, llm_answers, hyde_show_intermediate_in_accordio... function get_sources_answer (line 9511) | def get_sources_answer(query, docs, answer, function get_any_db (line 9638) | def get_any_db(db1s, langchain_mode, langchain_mode_paths, langchain_mod... function get_sources (line 9686) | def get_sources(db1s, selection_docs_state1, requests_state1, langchain_... function update_user_db (line 9753) | def update_user_db(file, db1s, selection_docs_state1, requests_state1, function get_lock_file (line 9793) | def get_lock_file(db1, langchain_mode): function _update_user_db (line 9807) | def _update_user_db(file, function get_all_sources_last_dict (line 10151) | def get_all_sources_last_dict(sources, gradio_upload_to_chatbot_num_max): function get_source_files_given_langchain_mode (line 10165) | def get_source_files_given_langchain_mode(db1s, selection_docs_state1, r... function get_source_files (line 10202) | def get_source_files(db=None, exceptions=None, metadatas=None): function update_and_get_source_files_given_langchain_mode (line 10303) | def update_and_get_source_files_given_langchain_mode(db1s, function get_db1 (line 10441) | def get_db1(db1s, langchain_mode1): function clean_doc (line 10450) | def clean_doc(docs1): function clone_documents (line 10458) | def clone_documents(documents: Iterable[Document]) -> List[Document]: function get_db_from_hf (line 10467) | def get_db_from_hf(dest=".", db_dir='db_dir_DriverlessAI_docs.zip'): function get_some_dbs_from_hf (line 10493) | def get_some_dbs_from_hf(dest='.', db_zips=None): function _create_local_weaviate_client (line 10505) | def _create_local_weaviate_client(): function _get_qdrant_options (line 10530) | def _get_qdrant_options(): function _get_unique_sources_in_qdrant (line 10554) | def _get_unique_sources_in_qdrant(db): FILE: src/gradio_funcs.py function evaluate_nochat (line 25) | def evaluate_nochat(*args1, default_kwargs1=None, str_api=False, plain_a... function visible_models_to_model_choice (line 406) | def visible_models_to_model_choice(visible_models1, model_states1, api=F... function clear_embeddings (line 433) | def clear_embeddings(langchain_mode1, db_type, db1s, dbs=None): function fix_text_for_gradio (line 447) | def fix_text_for_gradio(text, fix_new_lines=False, fix_latex_dollars=Tru... function get_images_num_max (line 492) | def get_images_num_max(model_choice, fun_args, visible_vision_models, do... function get_response (line 544) | def get_response(fun1, history, chatbot_role1, speaker1, tts_language1, ... function _get_response (line 847) | def _get_response(fun1, history, chatbot_role1, speaker1, tts_language1,... function prepare_audio (line 935) | def prepare_audio(chatbot_role1, speaker1, tts_language1, roles_state1, ... function prep_bot (line 987) | def prep_bot(*args, retry=False, which_model=0, kwargs_eval={}, plain_ap... function choose_exc (line 1187) | def choose_exc(x, is_public=True): function bot (line 1195) | def bot(*args, retry=False, kwargs_evaluate={}, kwargs={}, db_type=None,... function is_from_ui (line 1308) | def is_from_ui(requests_state1): function is_valid_key (line 1312) | def is_valid_key(enforce_h2ogpt_api_key, enforce_h2ogpt_ui_key, h2ogpt_a... function get_one_key (line 1335) | def get_one_key(h2ogpt_api_keys, enforce_h2ogpt_api_key): function get_model_max_length (line 1349) | def get_model_max_length(model_state1, model_state0): function get_llm_history (line 1362) | def get_llm_history(history): function gen1_fake (line 1374) | def gen1_fake(fun1, history): function merge_chat_conversation_history (line 1386) | def merge_chat_conversation_history(chat_conversation1, history): function update_langchain_mode_paths (line 1406) | def update_langchain_mode_paths(selection_docs_state1): function my_db_state_done (line 1419) | def my_db_state_done(state): function process_audio (line 1433) | def process_audio(file1, t1=0, t2=30): function allow_empty_instruction (line 1445) | def allow_empty_instruction(langchain_mode1, document_subset1, langchain... function update_prompt (line 1459) | def update_prompt(prompt_type1, prompt_dict1, model_state1, which_model=... function get_fun_with_dict_str_plain (line 1483) | def get_fun_with_dict_str_plain(default_kwargs, kwargs, **kwargs_evaluat... FILE: src/gradio_runner.py function my_get (line 43) | def my_get(url, **kwargs): function fix_pydantic_duplicate_validators_error (line 56) | def fix_pydantic_duplicate_validators_error(): function get_prompt_type1 (line 93) | def get_prompt_type1(is_public, **kwargs): function get_prompt_type2 (line 110) | def get_prompt_type2(is_public, **kwargs): function ask_block (line 126) | def ask_block(kwargs, instruction_label, visible_upload, file_types, mic... function go_gradio (line 273) | def go_gradio(**kwargs): function show_doc (line 6495) | def show_doc(db1s, selection_docs_state1, requests_state1, function get_inputs_list (line 6733) | def get_inputs_list(inputs_dict, model_lower, model_id=1): function update_user_db_gr (line 6766) | def update_user_db_gr(file, db1s, selection_docs_state1, requests_state1, function get_sources_gr (line 6837) | def get_sources_gr(db1s, selection_docs_state1, requests_state1, langcha... function get_source_files_given_langchain_mode_gr (line 6890) | def get_source_files_given_langchain_mode_gr(db1s, selection_docs_state1... function del_source_files_given_langchain_mode_gr (line 6935) | def del_source_files_given_langchain_mode_gr(db1s, selection_docs_state1... function update_and_get_source_files_given_langchain_mode_gr (line 6976) | def update_and_get_source_files_given_langchain_mode_gr(db1s, function set_userid_gr (line 7072) | def set_userid_gr(db1s, requests_state1, get_userid_auth): function set_dbid_gr (line 7077) | def set_dbid_gr(db1): function set_userid_direct_gr (line 7082) | def set_userid_direct_gr(db1s, userid, username): FILE: src/gradio_themes.py class H2oTheme (line 72) | class H2oTheme(Soft): method __init__ (line 73) | def __init__( class SoftTheme (line 151) | class SoftTheme(Soft): method __init__ (line 152) | def __init__( function get_h2o_title (line 212) | def get_h2o_title(title, description, visible_h2ogpt_qrcode): function get_simple_title (line 231) | def get_simple_title(title, description): function get_dark_js (line 235) | def get_dark_js() -> str: function get_heap_js (line 245) | def get_heap_js(heapAppId: str) -> str: function wrap_js_to_lambda (line 251) | def wrap_js_to_lambda(num_params: int, *args: str) -> str: FILE: src/h2o_serpapi.py class H2OSerpAPIWrapper (line 12) | class H2OSerpAPIWrapper(SerpAPIWrapper): method get_search_documents (line 13) | def get_search_documents(self, query, method arun (line 41) | async def arun(self, query: str, headsize: int, **kwargs: typing.Any) ... method run (line 45) | def run(self, query: str, headsize: int, **kwargs: typing.Any) -> list: method _process_response (line 50) | def _process_response(res: dict, query: str, headsize: int) -> list: method __process_response (line 58) | def __process_response(res: dict, query: str, headsize: int) -> list: method results (line 169) | def results(self, query: str) -> dict: FILE: src/h2oai_pipeline.py class H2OTextGenerationPipeline (line 11) | class H2OTextGenerationPipeline(TextGenerationPipeline): method __init__ (line 12) | def __init__(self, *args, debug=False, chat=False, stream_output=False, method get_token_count (line 104) | def get_token_count(x, tokenizer): method limit_prompt (line 124) | def limit_prompt(prompt_text, tokenizer, max_prompt_length=None, buffe... method preprocess (line 182) | def preprocess(self, prompt_text, prefix="", handle_long_generation=No... method _preprocess (line 200) | def _preprocess( method _postprocess (line 271) | def _postprocess(self, model_outputs, return_type=ReturnType.FULL_TEXT... method postprocess (line 313) | def postprocess(self, model_outputs, return_type=ReturnType.FULL_TEXT,... method _forward (line 357) | def _forward(self, model_inputs, **generate_kwargs): method __forward (line 381) | def __forward(self, model_inputs, **generate_kwargs): FILE: src/image_captions.py class ImageCaptionLoader (line 37) | class ImageCaptionLoader(BaseLoader): method __init__ (line 45) | def __init__( method load (line 67) | def load(self) -> List[Document]: method _get_captions_and_metadata (line 90) | def _get_captions_and_metadata( class H2OImageCaptionLoader (line 131) | class H2OImageCaptionLoader(ImageCaptionLoader): method __init__ (line 134) | def __init__(self, path_images: Union[str, List[str]] = None, method set_context (line 177) | def set_context(self): method load_model (line 201) | def load_model(self): method set_image_paths (line 249) | def set_image_paths(self, path_images: Union[str, List[str]]): method load (line 258) | def load(self, prompt=None) -> List[Document]: method unload_model (line 272) | def unload_model(self): method _get_captions_and_metadata (line 277) | def _get_captions_and_metadata( FILE: src/image_doctr.py class H2OOCRLoader (line 19) | class H2OOCRLoader(ImageCaptionLoader): method __init__ (line 22) | def __init__(self, path_images: Union[str, List[str]] = None, layout_a... method set_context (line 32) | def set_context(self): method load_model (line 47) | def load_model(self): method unload_model (line 64) | def unload_model(self): method set_document_paths (line 75) | def set_document_paths(self, document_paths: Union[str, List[str]]): method load (line 84) | def load(self, prompt=None) -> List[Document]: method _get_captions_and_metadata (line 99) | def _get_captions_and_metadata( function boxes_sort (line 151) | def boxes_sort(boxes): function is_same_line (line 163) | def is_same_line(box1, box2): function union_box (line 179) | def union_box(box1, box2): function space_layout (line 193) | def space_layout(texts, boxes, threshold_show_spaces=8, threshold_char_w... function read_pdf (line 250) | def read_pdf( FILE: src/image_pix2struct.py class H2OPix2StructLoader (line 16) | class H2OPix2StructLoader(ImageCaptionLoader): method __init__ (line 19) | def __init__(self, path_images: Union[str, List[str]] = None, model_ty... method set_context (line 26) | def set_context(self): method load_model (line 38) | def load_model(self): method unload_model (line 54) | def unload_model(self): method set_image_paths (line 59) | def set_image_paths(self, path_images: Union[str, List[str]]): method load (line 68) | def load(self, prompt=None) -> List[Document]: method _get_captions_and_metadata (line 81) | def _get_captions_and_metadata( FILE: src/image_utils.py function largest_contour (line 10) | def largest_contour(contours): function is_contour_acceptable (line 23) | def is_contour_acceptable(contour, image, size_threshold=0.1, aspect_rat... function file_to_cv2 (line 46) | def file_to_cv2(img_file): function align_image (line 68) | def align_image(img_file): function correct_rotation (line 110) | def correct_rotation(img_file, border_size=50): function pad_resize_image_file (line 166) | def pad_resize_image_file(img_file, relaxed_resize=False): function resize_image (line 185) | def resize_image(image, return_none_if_no_change=True, max_dimension=2048): function pad_resize_image (line 209) | def pad_resize_image(image, return_none_if_no_change=False, max_dimensio... function fix_image_file (line 269) | def fix_image_file(file, do_align=False, do_rotate=False, do_pad=False, ... function get_image_types (line 285) | def get_image_types(): function get_image_file (line 297) | def get_image_file(image_file, image_control, document_choice, base_mode... FILE: src/langchain_mistralai/chat_models.py function _create_retry_decorator (line 74) | def _create_retry_decorator( function _convert_mistral_chat_message_to_message (line 88) | def _convert_mistral_chat_message_to_message( function _raise_on_error (line 127) | def _raise_on_error(response: httpx.Response) -> None: function _araise_on_error (line 139) | async def _araise_on_error(response: httpx.Response) -> None: function _aiter_sse (line 151) | async def _aiter_sse( function acompletion_with_retry (line 163) | async def acompletion_with_retry( function _convert_delta_to_message_chunk (line 189) | def _convert_delta_to_message_chunk( function _format_tool_call_for_mistral (line 237) | def _format_tool_call_for_mistral(tool_call: ToolCall) -> dict: function _format_invalid_tool_call_for_mistral (line 251) | def _format_invalid_tool_call_for_mistral(invalid_tool_call: InvalidTool... function _convert_message_to_mistral_chat_message (line 265) | def _convert_message_to_mistral_chat_message( class ChatMistralAI (line 317) | class ChatMistralAI(BaseChatModel): class Config (line 339) | class Config: method _default_params (line 346) | def _default_params(self) -> Dict[str, Any]: method _client_params (line 379) | def _client_params(self) -> Dict[str, Any]: method completion_with_retry (line 383) | def completion_with_retry( method _combine_llm_outputs (line 415) | def _combine_llm_outputs(self, llm_outputs: List[Optional[dict]]) -> d... method validate_environment (line 432) | def validate_environment(cls, values: Dict) -> Dict: method _generate (line 472) | def _generate( method _create_chat_result (line 494) | def _create_chat_result(self, response: Dict) -> ChatResult: method _create_message_dicts (line 513) | def _create_message_dicts( method _stream (line 526) | def _stream( method _astream (line 553) | async def _astream( method _agenerate (line 580) | async def _agenerate( method bind_tools (line 602) | def bind_tools( method with_structured_output (line 628) | def with_structured_output( method _identifying_params (line 826) | def _identifying_params(self) -> Dict[str, Any]: method _llm_type (line 831) | def _llm_type(self) -> str: method lc_secrets (line 836) | def lc_secrets(self) -> Dict[str, str]: method is_lc_serializable (line 840) | def is_lc_serializable(cls) -> bool: method get_lc_namespace (line 845) | def get_lc_namespace(cls) -> List[str]: FILE: src/langchain_openai_local.py class H2OBaseChatOpenAI (line 36) | class H2OBaseChatOpenAI: method _stream (line 37) | def _stream( method mod_cg_chunk (line 72) | def mod_cg_chunk(self, cg_chunk: ChatGenerationChunk) -> ChatGeneratio... method _generate (line 80) | def _generate( method _create_chat_result (line 105) | def _create_chat_result(self, response: Union[dict, BaseModel]) -> Cha... method _astream (line 132) | async def _astream( method _agenerate (line 167) | async def _agenerate( class H2OBaseAzureChatOpenAI (line 194) | class H2OBaseAzureChatOpenAI(H2OBaseChatOpenAI, AzureChatOpenAI): FILE: src/llama_flash_attn_monkey_patch.py function forward (line 14) | def forward( function _prepare_decoder_attention_mask (line 101) | def _prepare_decoder_attention_mask( function replace_llama_attn_with_flash_attn (line 108) | def replace_llama_attn_with_flash_attn(): FILE: src/llm_exllama.py class H2OExLlamaTokenizer (line 17) | class H2OExLlamaTokenizer(ExLlamaTokenizer): method __call__ (line 18) | def __call__(self, text, *args, **kwargs): class H2OExLlamaGenerator (line 22) | class H2OExLlamaGenerator(ExLlamaGenerator): method is_exlama (line 23) | def is_exlama(self): class Exllama (line 27) | class Exllama(LLM): method get_model_path_at (line 92) | def get_model_path_at(path): method configure_object (line 106) | def configure_object(params, values, logfunc): method validate_environment (line 121) | def validate_environment(cls, values: Dict) -> Dict: method _llm_type (line 223) | def _llm_type(self) -> str: method get_num_tokens (line 227) | def get_num_tokens(self, text: str) -> int: method get_token_ids (line 231) | def get_token_ids(self, text: str) -> List[int]: method _call (line 236) | def _call( class MatchStatus (line 261) | class MatchStatus(Enum): method match_status (line 266) | def match_status(self, sequence: str, banned_sequences: List[str]): method stream (line 275) | def stream( FILE: src/loaders.py function get_loaders (line 7) | def get_loaders(model_name, reward_type, llama_type=None, function get_tokenizer (line 155) | def get_tokenizer(tokenizer_loader, tokenizer_base_model, local_files_on... FILE: src/make_db.py function glob_to_db (line 14) | def glob_to_db(user_path, chunk=True, chunk_size=512, verbose=False, function make_db_main (line 119) | def make_db_main(use_openai_embedding: bool = False, FILE: src/model_utils.py function switch_a_roo_llama (line 37) | def switch_a_roo_llama(base_model, model_path_llama, load_gptq, load_awq... function get_config (line 106) | def get_config(base_model, function get_non_lora_model (line 254) | def get_non_lora_model(base_model, model_loader, load_half, function get_client_from_inference_server (line 359) | def get_client_from_inference_server(inference_server, base_model=None, function get_model_retry (line 420) | def get_model_retry(**kwargs): function get_root_url (line 446) | def get_root_url(url): function get_inf_models (line 472) | def get_inf_models(inference_server, verbose=False): function get_model (line 534) | def get_model( function get_hf_model (line 1246) | def get_hf_model(load_8bit: bool = False, function set_model_max_len (line 1545) | def set_model_max_len(max_seq_len, tokenizer, verbose=False, reward_type... function pop_unused_model_kwargs (line 1559) | def pop_unused_model_kwargs(model_kwargs): function get_score_model (line 1572) | def get_score_model(score_model: str = None, function prep_model_state_none (line 1654) | def prep_model_state_none(): function model_lock_to_state (line 1664) | def model_lock_to_state(model_dict1, cache_model_state=False, **kwargs): function _model_lock_to_state (line 1693) | def _model_lock_to_state(model_dict_json, kwargs_json): function __model_lock_to_state (line 1700) | def __model_lock_to_state(model_dict1, **kwargs): function get_on_disk_models (line 1866) | def get_on_disk_models(llamacpp_path, use_auth_token, trust_remote_code): FILE: src/output_parser.py class H2OMRKLOutputParser (line 71) | class H2OMRKLOutputParser(MRKLOutputParser): method get_format_instructions (line 74) | def get_format_instructions(self) -> str: method parse (line 77) | def parse(self, text: str) -> Union[AgentAction, AgentFinish]: method _type (line 117) | def _type(self) -> str: class H2OPythonMRKLOutputParser (line 121) | class H2OPythonMRKLOutputParser(H2OMRKLOutputParser): method get_format_instructions (line 122) | def get_format_instructions(self) -> str: FILE: src/pandas_agent_langchain.py function _get_multi_prompt (line 31) | def _get_multi_prompt( function _get_single_prompt (line 75) | def _get_single_prompt( function _get_prompt_and_tools (line 117) | def _get_prompt_and_tools( function _get_functions_single_prompt (line 164) | def _get_functions_single_prompt( function _get_functions_multi_prompt (line 193) | def _get_functions_multi_prompt( function _get_functions_prompt_and_tools (line 230) | def _get_functions_prompt_and_tools( function create_pandas_dataframe_agent (line 277) | def create_pandas_dataframe_agent( function create_csv_agent (line 364) | def create_csv_agent( FILE: src/prepare_offline.py function noop_load (line 1) | def noop_load(*args, **kwargs): function go_prepare_offline (line 5) | def go_prepare_offline(*args, **kwargs): FILE: src/prompter.py function get_prompt (line 287) | def get_prompt(prompt_type, prompt_dict, context, reduced, making_contex... function generate_prompt (line 1570) | def generate_prompt(data_point, prompt_type, prompt_dict, reduced, makin... function inject_chatsep (line 1643) | def inject_chatsep(prompt_type, prompt, chat_sep=None): class Prompter (line 1650) | class Prompter(object): method __init__ (line 1651) | def __init__(self, prompt_type, prompt_dict, debug=False, stream_outpu... method stop_sequences (line 1696) | def stop_sequences(self): method generate_prompt (line 1702) | def generate_prompt(self, data_point, reduced=False, context_from_hist... method get_response (line 1744) | def get_response(self, outputs, prompt=None, sanitize_bot_response=Fal... method fix_text (line 1848) | def fix_text(prompt_type1, text1): function step_forward_prompts (line 1883) | def step_forward_prompts(which): function step_back_prompts (line 1898) | def step_back_prompts(which): function get_vllm_extra_dict (line 1922) | def get_vllm_extra_dict(tokenizer, stop_sequences=[], repetition_penalty... function get_system_prompts (line 2066) | def get_system_prompts(): function get_llava_prompts (line 2086) | def get_llava_prompts(): function get_response_verification_prompt (line 2095) | def get_response_verification_prompt(instruction, function get_correctness_eval_verification_prompt (line 2164) | def get_correctness_eval_verification_prompt(query, function get_faithfulness_eval_verification_prompt (line 2191) | def get_faithfulness_eval_verification_prompt(information, function get_faithfulness_refine_verification_prompt (line 2214) | def get_faithfulness_refine_verification_prompt(information, function get_relevancy_eval_prompt (line 2240) | def get_relevancy_eval_prompt(query_and_response, context): function get_relevancy_refine_prompt (line 2261) | def get_relevancy_refine_prompt(query_str, context_str): function gradio_to_llm (line 2282) | def gradio_to_llm(x, bot=False): function history_for_llm (line 2310) | def history_for_llm(history): function get_llm_history (line 2328) | def get_llm_history(history, only_text=False): function apply_chat_template (line 2357) | def apply_chat_template(instruction, system_prompt, history, function template_supports_system_prompt (line 2414) | def template_supports_system_prompt(tokenizer): function convert_messages_and_extract_images (line 2431) | def convert_messages_and_extract_images(tuple_list): function model_name_to_prompt_type (line 2464) | def model_name_to_prompt_type(model_name, inference_server, FILE: src/prompter_utils.py function get_use_chat_template (line 6) | def get_use_chat_template(tokenizer, prompt_type=None): function has_chat_template (line 14) | def has_chat_template(tokenizer): function get_chat_template (line 22) | def get_chat_template(tokenizer): function base64_encode_jinja_template (line 32) | def base64_encode_jinja_template(template_str): function base64_decode_jinja_template (line 38) | def base64_decode_jinja_template(encoded_str): function is_base64 (line 48) | def is_base64(s): FILE: src/read_wiki_full.py function unescape (line 22) | def unescape(x): function get_views (line 33) | def get_views(): class MWDumpDirectLoader (line 46) | class MWDumpDirectLoader(MWDumpLoader): method __init__ (line 47) | def __init__(self, data: str, encoding: Optional[str] = "utf8", method load (line 61) | def load(self) -> List[Document]: function search_index (line 105) | def search_index(search_term, index_filename): function get_start_bytes (line 121) | def get_start_bytes(index_filename): function get_wiki_filenames (line 131) | def get_wiki_filenames(): function get_documents_by_search_term (line 141) | def get_documents_by_search_term(search_term): function get_one_chunk (line 153) | def get_one_chunk(wiki_filename, start_byte, end_byte, return_file=True, function get_all_documents (line 180) | def get_all_documents(small_test=2, n_jobs=None, use_views=True): function test_by_search_term (line 220) | def test_by_search_term(): function test_start_bytes (line 231) | def test_start_bytes(): function test_get_all_documents (line 236) | def test_get_all_documents(): function get_one_pageviews (line 245) | def get_one_pageviews(fil): function test_agg_pageviews (line 261) | def test_agg_pageviews(gen_files=False): function test_reduce_pageview (line 283) | def test_reduce_pageview(): function test_do_wiki_full_all (line 309) | def test_do_wiki_full_all(): FILE: src/sagemaker.py class ChatContentHandler (line 11) | class ChatContentHandler(LLMContentHandler): method transform_input (line 15) | def transform_input(self, prompt: str, model_kwargs: typing.Dict) -> b... method transform_output (line 24) | def transform_output(self, output: bytes) -> str: class BaseContentHandler (line 29) | class BaseContentHandler(LLMContentHandler): method transform_input (line 33) | def transform_input(self, prompt: str, model_kwargs: typing.Dict) -> b... method transform_output (line 37) | def transform_output(self, output: bytes) -> str: class H2OSagemakerEndpoint (line 42) | class H2OSagemakerEndpoint(SagemakerEndpoint): method validate_environment (line 48) | def validate_environment(cls, values: typing.Dict) -> typing.Dict: method get_token_ids (line 83) | def get_token_ids(self, text: str) -> typing.List[int]: FILE: src/stopping.py function update_terminate_responses (line 10) | def update_terminate_responses(terminate_response, tokenizer=None, trust... class StoppingCriteriaSub (line 45) | class StoppingCriteriaSub(StoppingCriteria): method __init__ (line 47) | def __init__(self, stops=[], stop_words=[], encounters=[], device="cud... method __call__ (line 65) | def __call__(self, input_ids: torch.LongTensor, scores: torch.FloatTen... function get_stopping (line 98) | def get_stopping(prompt_type, prompt_dict, tokenizer, device, base_model, FILE: src/stt.py function get_transcriber (line 11) | def get_transcriber(model="openai/whisper-base.en", use_gpu=True, gpu_id... function audio_bytes_to_numpy (line 25) | def audio_bytes_to_numpy(audio_bytes): function transcribe (line 45) | def transcribe(audio_state1, new_chunk, transcriber=None, max_chunks=Non... FILE: src/tts.py function get_speech_model (line 26) | def get_speech_model(): function gen_t5 (line 41) | def gen_t5(text, processor=None, model=None, speaker_embedding=None, voc... function get_tts_model (line 47) | def get_tts_model(t5_model="microsoft/speecht5_tts", function get_speakers (line 65) | def get_speakers(): function get_speakers_gr (line 76) | def get_speakers_gr(value=None): function process_audio (line 86) | def process_audio(sampling_rate, waveform): function predict_from_audio (line 106) | def predict_from_audio(processor, model, speaker_embedding, vocoder, aud... function generate_speech (line 124) | def generate_speech(response, speaker, function predict_from_text (line 162) | def predict_from_text(text, speaker, tts_speed, processor=None, model=No... function get_speaker_embedding (line 219) | def get_speaker_embedding(speaker, device): function _predict_from_text (line 242) | def _predict_from_text(text, speaker, processor=None, model=None, vocode... function audio_to_html (line 270) | def audio_to_html(audio): function text_to_speech (line 281) | def text_to_speech(text, sr=16000): function test_bark (line 290) | def test_bark(): FILE: src/tts_coqui.py function list_models (line 26) | def list_models(): function get_xtt (line 31) | def get_xtt(model_name="tts_models/multilingual/multi-dataset/xtts_v2", ... function get_latent (line 77) | def get_latent(speaker_wav, voice_cleanup=False, model=None, gpt_cond_le... function get_voice_streaming (line 96) | def get_voice_streaming(prompt, language, latent, suffix="0", model=None... function generate_speech (line 136) | def generate_speech(response, function sentence_to_wave (line 188) | def sentence_to_wave(sentence, supported_languages, tts_speed, function get_role_to_wave_map (line 280) | def get_role_to_wave_map(): function allowed_roles (line 290) | def allowed_roles(): function get_roles (line 294) | def get_roles(choices=None, value=None): function predict_from_text (line 308) | def predict_from_text(response, chatbot_role, language, roles_map, tts_s... function filter_wave_1 (line 361) | def filter_wave_1(speaker_wav): function filter_wave_2 (line 380) | def filter_wave_2(speaker_wav): function get_languages_gr (line 422) | def get_languages_gr(visible=True, value=None): FILE: src/tts_sentence_parsing.py function setup_nltk (line 7) | def setup_nltk(): function init_sentence_state (line 18) | def init_sentence_state(): function unpack_state (line 23) | def unpack_state(sentence_state): function pack_state (line 30) | def pack_state(sentence_state, *args): function split_sentences (line 40) | def split_sentences(sentence, n=250): function _get_sentences (line 90) | def _get_sentences(response, verbose=False, min_start=15, max_length=250): function get_sentence (line 108) | def get_sentence(response, sentence_state, is_final=False, verbose=False): function clean_sentence (line 131) | def clean_sentence(sentence, verbose=False): function detect_language (line 206) | def detect_language(prompt, supported_languages, verbose=False): FILE: src/tts_utils.py function get_wave_header (line 11) | def get_wave_header(frame_input=b"", channels=1, sample_width=2, sample_... function prepare_speech (line 27) | def prepare_speech(sr=24000): function get_no_audio (line 32) | def get_no_audio(return_as_byte=True, return_nonbyte_as_file=False, sr=N... function combine_audios (line 43) | def combine_audios(audios, audio=None, channels=1, sample_width=2, sr=24... function chunk_speed_change (line 78) | def chunk_speed_change(chunk, sr, tts_speed=1.0): function pydub_to_np (line 112) | def pydub_to_np(audio: pydub.AudioSegment) -> (np.ndarray, int): FILE: src/utils.py function H2O_Fire (line 55) | def H2O_Fire(component=None): function set_seed (line 82) | def set_seed(seed: int): function flatten_list (line 99) | def flatten_list(lis): function clear_torch_cache (line 110) | def clear_torch_cache(allow_skip=False): function ping (line 123) | def ping(): function ping_gpu (line 131) | def ping_gpu(): function ping_gpu_memory (line 143) | def ping_gpu_memory(): function get_torch_allocated (line 150) | def get_torch_allocated(): function get_device (line 155) | def get_device(n_gpus=None): function system_info (line 167) | def system_info(): function system_info_print (line 224) | def system_info_print(): function zip_data (line 234) | def zip_data(root_dirs=None, zip_file=None, base_dir='./', fail_any_exce... function _zip_data (line 244) | def _zip_data(root_dirs=None, zip_file=None, base_dir='./'): function tar_data (line 269) | def tar_data(root_dirs=None, tar_file=None, base_dir='./', fail_any_exce... function _tar_data (line 279) | def _tar_data(root_dirs=None, tar_file=None, base_dir='./'): function save_generate_output (line 304) | def save_generate_output(prompt=None, output=None, base_model=None, save... function _save_generate_tokens (line 319) | def _save_generate_tokens(response_no_refs, extra_dict): function _save_generate_output (line 329) | def _save_generate_output(prompt=None, output=None, base_model=None, sav... function s3up (line 373) | def s3up(filename): function _s3up (line 382) | def _s3up(filename): function get_githash (line 405) | def get_githash(): function copy_code (line 426) | def copy_code(run_id): class NullContext (line 445) | class NullContext(threading.local): method __init__ (line 452) | def __init__(self, *args, **kwargs): method __enter__ (line 455) | def __enter__(self): method __exit__ (line 458) | def __exit__(self, exc_type, exc_value, exc_traceback): method finally_act (line 461) | def finally_act(self): class AsyncNullContext (line 465) | class AsyncNullContext(threading.local): method __init__ (line 472) | def __init__(self, *args, **kwargs): method __aenter__ (line 475) | async def __aenter__(self): method __aexit__ (line 478) | async def __aexit__(self, exc_type, exc_value, exc_traceback): method finally_act (line 481) | async def finally_act(self): function wrapped_partial (line 485) | def wrapped_partial(func, *args, **kwargs): class ThreadException (line 498) | class ThreadException(Exception): class EThread (line 502) | class EThread(threading.Thread): method __init__ (line 504) | def __init__(self, group=None, target=None, name=None, method run (line 514) | def run(self): method join (line 534) | def join(self, timeout=None): function import_matplotlib (line 544) | def import_matplotlib(): function get_sha (line 558) | def get_sha(value): function sanitize_filename (line 562) | def sanitize_filename(name, file_length_limit=250): function shutil_rmtree (line 585) | def shutil_rmtree(*args, **kwargs): function remove (line 594) | def remove(path: str): function makedirs (line 606) | def makedirs(path, exist_ok=True, tmp_ok=False, use_base=False): function atomic_move_simple (line 649) | def atomic_move_simple(src, dst): function atomic_copy (line 657) | def atomic_copy(src="", dst=None, content=None): function move_tree (line 673) | def move_tree(src, dst, include_root=True): function copy_tree (line 696) | def copy_tree(src, dst, follow_symlink=False): function download_simple (line 711) | def download_simple(url, dest=None, overwrite=False, verbose=False): function download (line 770) | def download(url, dest=None, dest_path=None): function get_doc (line 816) | def get_doc(x): function get_source (line 820) | def get_source(x): function markdown_to_html (line 824) | def markdown_to_html(content): function is_markdown (line 841) | def is_markdown(string): function get_accordion_named (line 856) | def get_accordion_named(content, title, font_size=8): function hyde_titles (line 863) | def hyde_titles(level): function get_accordion (line 877) | def get_accordion(x, font_size=2, head_acc=50): function get_url (line 883) | def get_url(x, from_str=False, short_name=False, font_size=2): function get_short_name (line 903) | def get_short_name(name, maxl=50): function cuda_vis_check (line 914) | def cuda_vis_check(total_gpus): function get_ngpus_vis (line 942) | def get_ngpus_vis(raise_if_exception=True): function get_mem_gpus (line 978) | def get_mem_gpus(raise_if_exception=True, ngpus=None): class ForkContext (line 1011) | class ForkContext(threading.local): method __init__ (line 1017) | def __init__(self, args=None, kwargs=None, forkdata_capable=True): method __enter__ (line 1033) | def __enter__(self): method __exit__ (line 1045) | def __exit__(self, exc_type, exc_value, exc_traceback): method finally_act (line 1048) | def finally_act(self): class _ForkDataContext (line 1058) | class _ForkDataContext(threading.local): method __init__ (line 1059) | def __init__( method args (line 1076) | def args(self) -> Tuple: method args (line 1081) | def args(self, args): method kwargs (line 1090) | def kwargs(self) -> Dict: method kwargs (line 1095) | def kwargs(self, kwargs): method _reset (line 1103) | def _reset(self): method get_args_kwargs (line 1108) | def get_args_kwargs(self, func, args, kwargs) -> Tuple[Callable, Tuple... method get_args_kwargs_for_traced_func (line 1122) | def get_args_kwargs_for_traced_func(func, args, kwargs): function using_conda (line 1153) | def using_conda(): function get_python_paths (line 1162) | def get_python_paths(): function _traced_func (line 1187) | def _traced_func(func, *args, **kwargs): function call_subprocess_onetask (line 1197) | def call_subprocess_onetask(func, args=None, kwargs=None): class ProgressParallel (line 1217) | class ProgressParallel(Parallel): method __init__ (line 1218) | def __init__(self, use_tqdm=True, total=None, *args, **kwargs): method __call__ (line 1223) | def __call__(self, *args, **kwargs): method print_progress (line 1227) | def print_progress(self): function get_kwargs (line 1234) | def get_kwargs(func, exclude_names=None, **kwargs): function hash_file (line 1283) | def hash_file(file): function start_faulthandler (line 1310) | def start_faulthandler(): function get_hf_server (line 1323) | def get_hf_server(inference_server): class FakeTokenizer (line 1374) | class FakeTokenizer: method __init__ (line 1380) | def __init__(self, model_max_length=2048, method encode (line 1417) | def encode(self, x, *args, return_tensors="pt", **kwargs): method decode (line 1446) | def decode(self, x, *args, **kwargs): method num_tokens_from_string (line 1465) | def num_tokens_from_string(self, prompt: str) -> int: method heuristic_encode (line 1482) | def heuristic_encode(self, text: str) -> list: method __call__ (line 1489) | def __call__(self, x, *args, **kwargs): function get_local_ip (line 1493) | def get_local_ip(): function set_openai (line 1678) | def set_openai(inference_server, model_name=None): function get_model_name (line 1785) | def get_model_name(model_name, openai_client): function get_list_or_str (line 1805) | def get_list_or_str(x): function deepcopy_by_pickle_object (line 1819) | def deepcopy_by_pickle_object(object): function url_alive (line 1832) | def url_alive(url): function return_good_url (line 1846) | def return_good_url(url): function is_probably_url (line 1865) | def is_probably_url(url): function dict_to_html (line 1872) | def dict_to_html(x, small=True, api=False): function split_into_sentences (line 1888) | def split_into_sentences(text): function text_to_html (line 1894) | def text_to_html(x, api=False): function lg_to_gr (line 1914) | def lg_to_gr( function enqueue_output (line 2016) | def enqueue_output(file, queue): function read_popen_pipes (line 2023) | def read_popen_pipes(p): function start_process (line 2048) | def start_process(cmd): function execute_cmd_stream (line 2058) | def execute_cmd_stream(cmd=None, script_content=None, cwd=None, env=None... function str_to_list (line 2188) | def str_to_list(x, allow_none=False): function str_to_dict (line 2210) | def str_to_dict(x): function get_token_count (line 2225) | def get_token_count(x, tokenizer, token_count_fun=None, add_special_toke... function reverse_ucurve_list (line 2255) | def reverse_ucurve_list(lst): function undo_reverse_ucurve_list (line 2275) | def undo_reverse_ucurve_list(lst): function get_size (line 2301) | def get_size(start_path='.'): function get_test_name_core (line 2313) | def get_test_name_core(): class FullSet (line 2319) | class FullSet(set): method __contains__ (line 2320) | def __contains__(self, item): function create_relative_symlink (line 2327) | def create_relative_symlink(target, link_name): function get_gradio_tmp (line 2362) | def get_gradio_tmp(): function in_gradio_root (line 2369) | def in_gradio_root(file): function get_is_gradio_h2oai (line 2376) | def get_is_gradio_h2oai(): function split_list (line 2384) | def split_list(input_list, split_size): function get_lock_file (line 2389) | def get_lock_file(name): function merge_dict (line 2398) | def merge_dict(dict1, dict2): function is_uuid4 (line 2404) | def is_uuid4(string): function is_full_git_hash (line 2410) | def is_full_git_hash(s): function get_show_username (line 2415) | def get_show_username(username1): function get_code_blocks (line 2427) | def get_code_blocks(response): function get_json (line 2431) | def get_json(response, fixup=True, json_schema_type=None): function extract_values (line 2441) | def extract_values(data): function contains_schema (line 2468) | def contains_schema(data): function handle_json (line 2483) | def handle_json(data): function repair_json_by_type (line 2490) | def repair_json_by_type(response, json_schema_type=None): function _get_json (line 2512) | def _get_json(response, fixup=True, json_schema_type=None): function preprocess_code_blocks (line 2554) | def preprocess_code_blocks(stream_content): function extract_code_block_content (line 2562) | def extract_code_block_content(stream_content): function has_starting_code_block (line 2573) | def has_starting_code_block(text): function looks_like_json (line 2578) | def looks_like_json(text): function is_json_vllm (line 2593) | def is_json_vllm(model, base_model, inference_server, verbose=False): function get_vllm_version (line 2616) | def get_vllm_version(openai_client, inference_server, verbose=False): function get_docs_tokens (line 2640) | def get_docs_tokens(tokenizer, text_context_list=[], max_input_tokens=No... function get_limited_text (line 2675) | def get_limited_text(hard_limit_tokens, text, tokenizer, verbose=False): function deduplicate_names (line 2714) | def deduplicate_names(names): function download_image (line 2736) | def download_image(image_url, save_dir): function check_input_type (line 2779) | def check_input_type(input_string): function get_youtube_urls (line 2812) | def get_youtube_urls(): function get_llama_lower_hf (line 2997) | def get_llama_lower_hf(llama_lower): function get_depth_normal (line 3005) | def get_depth_normal(lst): function get_gradio_depth (line 3012) | def get_gradio_depth(lst): function is_empty (line 3033) | def is_empty(obj): function create_typed_dict (line 3071) | def create_typed_dict(schema: Dict[str, Any], name: str = "Schema") -> t... function get_supports_schema (line 3109) | def get_supports_schema(inference_server, base_model, response_format='j... function dedup_list (line 3135) | def dedup_list(x): FILE: src/utils_langchain.py class StreamingGradioCallbackHandler (line 38) | class StreamingGradioCallbackHandler(BaseCallbackHandler): method __init__ (line 43) | def __init__(self, timeout: Optional[float] = None, block=True, max_ti... method on_llm_start (line 55) | def on_llm_start( method on_llm_new_token (line 66) | def on_llm_new_token(self, token: str, **kwargs: Any) -> None: method on_llm_end (line 77) | def on_llm_end(self, response: LLMResult, **kwargs: Any) -> None: method on_llm_error (line 81) | def on_llm_error( method __iter__ (line 87) | def __iter__(self): method __next__ (line 90) | def __next__(self): class H2OCharacterTextSplitter (line 111) | class H2OCharacterTextSplitter(RecursiveCharacterTextSplitter): method __init__ (line 112) | def __init__( method from_huggingface_tokenizer (line 125) | def from_huggingface_tokenizer(cls, tokenizer: Any, **kwargs: Any) -> ... function select_docs_with_score (line 132) | def select_docs_with_score(docs_with_score, top_k_docs, one_doc_size): function split_merge_docs (line 144) | def split_merge_docs(docs_with_score, tokenizer=None, max_input_tokens=N... function _chunk_sources (line 294) | def _chunk_sources(sources, chunk=True, chunk_size=512, language=None, d... function add_parser (line 361) | def add_parser(docs1, parser): function _add_meta (line 365) | def _add_meta(docs1, file, headsize=50, filei=0, parser='NotSet', file_a... function fix_json_meta (line 388) | def fix_json_meta(docs1): class H2OMapReduceDocumentsChain (line 396) | class H2OMapReduceDocumentsChain(MapReduceDocumentsChain): method combine_docs (line 400) | def combine_docs( method acombine_docs (line 441) | async def acombine_docs( method terminate_callbacks (line 482) | def terminate_callbacks(self): method _chain_type (line 492) | def _chain_type(self) -> str: function _load_map_chain (line 496) | def _load_map_chain( function load_general_summarization_chain (line 560) | def load_general_summarization_chain( class H2OSemanticScholarAPIWrapper (line 601) | class H2OSemanticScholarAPIWrapper(BaseModel): method validate_environment (line 645) | def validate_environment(cls, values: Dict) -> Dict: method run (line 659) | def run(self, query: str) -> str: class H2OHuggingFaceHubEmbeddings (line 682) | class H2OHuggingFaceHubEmbeddings(HuggingFaceHubEmbeddings): method embed_documents (line 683) | def embed_documents(self, texts: List[str]) -> List[List[float]]: function make_sources_file (line 720) | def make_sources_file(langchain_mode, source_files_added): function convert_to_genai_schema (line 733) | def convert_to_genai_schema(json_schema: Union[Dict[str, Any], str], nam... function convert_object_schema (line 752) | def convert_object_schema(json_schema: Dict[str, Any], name: str) -> Sch... function convert_array_schema (line 772) | def convert_array_schema(json_schema: Dict[str, Any], name: str) -> Schema: function convert_primitive_schema (line 781) | def convert_primitive_schema(json_schema: Dict[str, Any], name: str) -> ... class PyMuPDF4LLMLoader (line 806) | class PyMuPDF4LLMLoader(BasePDFLoader): method __init__ (line 809) | def __init__( method _lazy_load (line 829) | def _lazy_load(self, **kwargs: Any) -> Iterator[Document]: method load (line 846) | def load(self, **kwargs: Any) -> List[Document]: method lazy_load (line 849) | def lazy_load(self) -> Iterator[Document]: class PyMuPDF4LLMParser (line 853) | class PyMuPDF4LLMParser(BaseBlobParser): method __init__ (line 856) | def __init__( method lazy_parse (line 869) | def lazy_parse(self, blob: Blob) -> Iterator[Document]: # type: ignor... method _extract_images_from_page (line 901) | def _extract_images_from_page( FILE: src/utils_procs.py function rlimitproc (line 10) | def rlimitproc(pp, rlim): function get_all_rlimit (line 28) | def get_all_rlimit(pid=None): function reulimit (line 44) | def reulimit(pid=None, verbose=False): function get_nproc_limit (line 85) | def get_nproc_limit(pid=None): function wrap_psutil (line 101) | def wrap_psutil(func): function psfunc_list (line 113) | def psfunc_list(func, *args, **kwargs): function psfunc (line 121) | def psfunc(func, *args, **kwargs): function psattr (line 141) | def psattr(obj, attr): function get_file_limit (line 160) | def get_file_limit(pid=None): FILE: src/utils_sys.py class StreamProxy (line 6) | class StreamProxy: method __init__ (line 7) | def __init__(self, original_stream): method write (line 10) | def write(self, *args, **kwargs): method flush (line 19) | def flush(self, *args, **kwargs): method handle_closed_file_error (line 28) | def handle_closed_file_error(self, operation): method close (line 36) | def close(self): method __getattr__ (line 47) | def __getattr__(self, name): method __setattr__ (line 50) | def __setattr__(self, name, value): class FinalizeStream (line 63) | class FinalizeStream: method __init__ (line 64) | def __init__(self, proxy): method __setattr__ (line 67) | def __setattr__(self, key, value): method __getattr__ (line 80) | def __getattr__(self, item): function protect_stream (line 84) | def protect_stream(stream_name): function protect_stdout_stderr (line 93) | def protect_stdout_stderr(): FILE: src/vision/extract_movie.py function extract_unique_frames (line 8) | def extract_unique_frames(urls=None, file=None, download_dir=None, expor... FILE: src/vision/flux.py function get_pipe_make_image (line 11) | def get_pipe_make_image(gpu_id): function get_pipe_make_image_2 (line 22) | def get_pipe_make_image_2(gpu_id): function make_image (line 33) | def make_image(prompt, filename=None, gpu_id='auto', pipe=None, FILE: src/vision/playv2.py function get_pipe_make_image (line 11) | def get_pipe_make_image(gpu_id): function make_image (line 26) | def make_image(prompt, filename=None, gpu_id='auto', pipe=None, FILE: src/vision/sdxl_turbo.py function get_device (line 14) | def get_device(gpu_id): function get_pipe_make_image (line 22) | def get_pipe_make_image(gpu_id='auto'): function make_image (line 30) | def make_image(prompt, filename=None, gpu_id='auto', pipe=None, function get_pipe_change_image (line 66) | def get_pipe_change_image(gpu_id='auto'): function change_image (line 73) | def change_image(prompt, init_image=None, init_file=None, filename=None,... FILE: src/vision/stable_diffusion_xl.py function get_pipe_make_image (line 10) | def get_pipe_make_image(gpu_id, refine=True, function make_image (line 56) | def make_image(prompt, FILE: src/vision/utils_vision.py function is_animated_gif (line 20) | def is_animated_gif(file_path): function gif_to_mp4 (line 36) | def gif_to_mp4(gif_path): function is_video_file (line 50) | def is_video_file(file_path): function img_to_base64 (line 71) | def img_to_base64(image_file, resolution=None, output_format=None, str_b... function base64_to_img (line 106) | def base64_to_img(img_str, output_path): function video_to_base64frames (line 133) | def video_to_base64frames(video_path): function video_to_frames (line 151) | def video_to_frames(video_path, output_dir, resolution=None, image_forma... function count_frames (line 233) | def count_frames(video_path): function process_file_list (line 252) | def process_file_list(file_list, output_dir, resolution=None, image_form... function fix_llava_prompt (line 309) | def fix_llava_prompt(file, function llava_prep (line 328) | def llava_prep(file_list, function _llava_prep (line 348) | def _llava_prep(file, function get_prompt_with_texts (line 395) | def get_prompt_with_texts(texts, prompt, max_new_tokens, min_max_new_tok... function get_llava_response (line 428) | def get_llava_response(file=None, function get_llava_stream (line 514) | def get_llava_stream(file, llava_model, function get_image_model_dict (line 663) | def get_image_model_dict(enable_image, function pdf_to_base64_pngs (line 709) | def pdf_to_base64_pngs(pdf_path, quality=75, max_size=(1024, 1024), ext=... FILE: tests/conftest.py function pytest_itemcollected (line 6) | def pytest_itemcollected(item): function pytest_sessionstart (line 10) | def pytest_sessionstart(session): FILE: tests/memory_hog_script.py function use_memory (line 4) | def use_memory(): FILE: tests/test_async_iterator_pipe.py class TestTimeoutIterator (line 6) | class TestTimeoutIterator(unittest.TestCase): method test_normal_iteration (line 8) | def test_normal_iteration(self): method test_multiple_next_after_exception (line 27) | def test_multiple_next_after_exception(self): method test_multiple_close (line 49) | def test_multiple_close(self): method test_put_after_close (line 70) | def test_put_after_close(self): method test_normal_iteration_via_for_loop (line 91) | def test_normal_iteration_via_for_loop(self): FILE: tests/test_async_timeout_iterator.py function iter_simple (line 7) | async def iter_simple(): function iter_with_sleep (line 12) | async def iter_with_sleep(): function iter_with_exception (line 20) | async def iter_with_exception(): class TestTimeoutIterator (line 27) | class TestTimeoutIterator(unittest.TestCase): method test_normal_iteration (line 29) | def test_normal_iteration(self): method test_normal_iteration_for_loop (line 45) | def test_normal_iteration_for_loop(self): method test_timeout_block (line 57) | def test_timeout_block(self): method test_timeout_block_for_loop (line 73) | def test_timeout_block_for_loop(self): method test_fixed_timeout (line 85) | def test_fixed_timeout(self): method test_fixed_timeout (line 100) | def test_fixed_timeout(self): method test_timeout_update (line 112) | def test_timeout_update(self): method test_custom_sentinel (line 131) | def test_custom_sentinel(self): method test_feature_timeout_reset (line 146) | def test_feature_timeout_reset(self): method test_function_set_reset_on_next (line 160) | def test_function_set_reset_on_next(self): method test_iterator_raises_exception (line 176) | def test_iterator_raises_exception(self): method test_interrupt_thread (line 190) | def test_interrupt_thread(self): FILE: tests/test_cli.py function test_cli (line 8) | def test_cli(monkeypatch): function test_cli_langchain (line 21) | def test_cli_langchain(base_model, monkeypatch): function test_cli_langchain_llamacpp (line 53) | def test_cli_langchain_llamacpp(monkeypatch): function test_cli_llamacpp (line 84) | def test_cli_llamacpp(monkeypatch): function test_cli_h2ogpt (line 113) | def test_cli_h2ogpt(monkeypatch): function test_cli_langchain_h2ogpt (line 127) | def test_cli_langchain_h2ogpt(monkeypatch): FILE: tests/test_client_calls.py function test_client1 (line 22) | def test_client1(): function test_client1_lock_choose_model (line 40) | def test_client1_lock_choose_model(): function test_client1_context (line 84) | def test_client1_context(base_model): function test_client1api (line 114) | def test_client1api(): function test_client1api_lean (line 134) | def test_client1api_lean(save_dir, admin_pass): function test_client1api_lean_lock_choose_model (line 195) | def test_client1api_lean_lock_choose_model(): function test_client1api_lean_chat_server (line 268) | def test_client1api_lean_chat_server(): function test_client_chat_nostream (line 288) | def test_client_chat_nostream(): function test_client_chat_nostream_gpt4all (line 295) | def test_client_chat_nostream_gpt4all(): function test_client_chat_nostream_gpt4all_llama (line 304) | def test_client_chat_nostream_gpt4all_llama(): function test_client_chat_nostream_llama7b (line 318) | def test_client_chat_nostream_llama7b(): function test_client_chat_nostream_llama2_long (line 336) | def test_client_chat_nostream_llama2_long(max_seq_len, prompt_num, model... function run_client_chat_with_server (line 1278) | def run_client_chat_with_server(prompt='Who are you?', stream_output=Fal... function test_client_chat_stream (line 1317) | def test_client_chat_stream(): function run_client_nochat_with_server (line 1321) | def run_client_nochat_with_server(prompt='Who are you?', stream_output=F... function test_client_nochat_stream (line 1358) | def test_client_nochat_stream(gradio_ui_stream_chunk_size, gradio_ui_str... function test_client_chat_stream_langchain (line 1368) | def test_client_chat_stream_langchain(): function test_client_chat_stream_langchain_steps (line 1392) | def test_client_chat_stream_langchain_steps(max_new_tokens, top_k_docs): function test_client_system_prompts (line 1536) | def test_client_system_prompts(system_prompt, chat_conversation): function test_client_long_chat (line 2410) | def test_client_long_chat(): function test_client_chat_stream_langchain_steps2 (line 2438) | def test_client_chat_stream_langchain_steps2(max_new_tokens, top_k_docs): function test_doc_hash (line 2505) | def test_doc_hash(): function test_client_chat_stream_long (line 2540) | def test_client_chat_stream_long(): function test_autogptq (line 2553) | def test_autogptq(base_model): function test_autoawq (line 2593) | def test_autoawq(): function check_langchain (line 2632) | def check_langchain(): function test_exllama (line 2689) | def test_exllama(mode): function test_attention_sinks (line 2738) | def test_attention_sinks(max_seq_len, attention_sinks): function test_client_long (line 2791) | def test_client_long(): function test_fast_up (line 2809) | def test_fast_up(): function test_fast_up_preload (line 2815) | def test_fast_up_preload(): function test_fast_up_auth (line 2832) | def test_fast_up_auth(): function test_fast_up_auth2 (line 2839) | def test_fast_up_auth2(): function test_lock_up (line 2853) | def test_lock_up(visible_models): function test_client_stress (line 2873) | def test_client_stress(repeat): function test_client_stress_stream (line 2910) | def test_client_stress_stream(repeat): function test_text_generation_inference_server1 (line 2929) | def test_text_generation_inference_server1(): function kill_function_server (line 2966) | def kill_function_server(): function test_client_chat_stream_langchain_steps3 (line 2977) | def test_client_chat_stream_langchain_steps3(loaders, enforce_h2ogpt_api... function run_client_chat_stream_langchain_steps3 (line 2987) | def run_client_chat_stream_langchain_steps3(loaders, enforce_h2ogpt_api_... function test_client_load_unload_models (line 3435) | def test_client_load_unload_models(model_choice): function test_client_curated_base_models (line 3597) | def test_client_curated_base_models(base_model, stream_output): function test_client_chat_stream_langchain_openai_embeddings (line 3630) | def test_client_chat_stream_langchain_openai_embeddings(): function test_client_clone (line 3680) | def test_client_clone(stream_output): function test_client_timeout (line 3704) | def test_client_timeout(stream_output, max_time): function test_client_chat_stream_langchain_fake_embeddings_stress (line 3780) | def test_client_chat_stream_langchain_fake_embeddings_stress(repeat): function test_client_upload_simple (line 3794) | def test_client_upload_simple(repeat): function test_client_chat_stream_langchain_fake_embeddings_stress_no_llm (line 3809) | def test_client_chat_stream_langchain_fake_embeddings_stress_no_llm(repe... function go_upload_gradio (line 3819) | def go_upload_gradio(): function test_client_chat_stream_langchain_fake_embeddings (line 3888) | def test_client_chat_stream_langchain_fake_embeddings(data_kind, base_mo... function run_client_chat_stream_langchain_fake_embeddings (line 4023) | def run_client_chat_stream_langchain_fake_embeddings(data_kind, base_mod... function test_client_summarization (line 4424) | def test_client_summarization(prompt_summary, inference_server, top_k_do... function test_client_summarization_from_text (line 4583) | def test_client_summarization_from_text(): function test_client_summarization_from_url (line 4651) | def test_client_summarization_from_url(url, top_k_docs): function test_fastsys (line 4723) | def test_fastsys(stream_output, bits, prompt_type): function test_hyde (line 4805) | def test_hyde(stream_output, hyde_level, hyde_template): function set_env (line 4864) | def set_env(tts_model): function test_client1_tts (line 4882) | def test_client1_tts(tts_model): function play_audio (line 4911) | def play_audio(audio, sr=16000): function test_client1_tts_stream (line 4943) | def test_client1_tts_stream(tts_model, base_model): function check_final_res (line 5000) | def check_final_res(res, base_model='llama'): function check_curl_plain_api (line 5023) | def check_curl_plain_api(): function test_client1_tts_api (line 5061) | def test_client1_tts_api(tts_model, stream_output, h2ogpt_key): function play_audio_str (line 5105) | def play_audio_str(audio_str1, n): function playsound_wav (line 5143) | def playsound_wav(x): function test_pure_client_test (line 5156) | def test_pure_client_test(): function test_client_upload_to_user_not_allowed (line 5183) | def test_client_upload_to_user_not_allowed(): function test_client_upload_to_my_not_allowed (line 5230) | def test_client_upload_to_my_not_allowed(): function test_client_upload_to_user_or_my_not_allowed (line 5277) | def test_client_upload_to_user_or_my_not_allowed(): function test_client1_image_qa_original (line 5305) | def test_client1_image_qa_original(): function test_client_chat_stream_langchain_metadata (line 5342) | def test_client_chat_stream_langchain_metadata(metadata_in_context): function test_client_openai_langchain (line 5379) | def test_client_openai_langchain(auth_access, guest_name, do_auth): function run_sound_test0 (line 5612) | def run_sound_test0(client, text): function run_sound_test1 (line 5624) | def run_sound_test1(client): function run_sound_test2 (line 5640) | def run_sound_test2(client): function run_sound_test3 (line 5656) | def run_sound_test3(client): function test_client_openai_chat_history (line 5735) | def test_client_openai_chat_history(base_model): function test_max_new_tokens (line 5826) | def test_max_new_tokens(max_new_tokens, temperature): function test_client1_image_qa (line 6021) | def test_client1_image_qa(langchain_action, langchain_mode, base_model): function get_creation_date (line 6130) | def get_creation_date(file_path): function test_client1_images_qa (line 6142) | def test_client1_images_qa(langchain_action, langchain_mode, base_model,... function test_pdf_to_base_64_images (line 6198) | def test_pdf_to_base_64_images(): function test_get_image_file (line 6211) | def test_get_image_file(): function get_test_server_client (line 6324) | def get_test_server_client(base_model): function test_guided_json (line 6363) | def test_guided_json(langchain_action, langchain_mode, response_format, ... function check_response (line 6430) | def check_response(response, base_model, guided_json): function openai_guided_json (line 6443) | def openai_guided_json(gradio_client, base_model, kwargs, use_instruction): function test_client1_image_text_qa (line 6580) | def test_client1_image_text_qa(langchain_action, langchain_mode, base_mo... function test_client1_lock_choose_model_via_api (line 6688) | def test_client1_lock_choose_model_via_api(admin_pass): function test_client1_lock_choose_model_via_api_vision (line 6730) | def test_client1_lock_choose_model_via_api_vision(admin_pass): function test_max_new_tokens_vs_min_max_new_tokens (line 6774) | def test_max_new_tokens_vs_min_max_new_tokens(): FILE: tests/test_client_readme.py function test_readme_example (line 9) | def test_readme_example(local_server, persist): FILE: tests/test_eval.py function test_eval1 (line 13) | def test_eval1(cpu, bits, base_model): function test_eval_json (line 20) | def test_eval_json(): function run_eval1 (line 54) | def run_eval1(cpu=False, bits=None, base_model='h2oai/h2ogpt-oig-oasst1-... function test_eval_json_langchain (line 262) | def test_eval_json_langchain(): FILE: tests/test_eval_models.py function test_score_eval (line 34) | def test_score_eval(base_model): function test_get_falcons (line 64) | def test_get_falcons(base_model): function test_get_landmark_llama (line 85) | def test_get_landmark_llama(): FILE: tests/test_imports.py function test_transformers (line 5) | def test_transformers(): FILE: tests/test_inference_servers.py function test_gradio_inference_server (line 24) | def test_gradio_inference_server(base_model, force_langchain_evaluate, d... function run_docker (line 192) | def run_docker(inf_port, base_model, low_mem_mode=False, do_shared=True): function gpus_cmd (line 242) | def gpus_cmd(): function run_vllm_docker (line 255) | def run_vllm_docker(inf_port, base_model, tokenizer=None): function run_h2ogpt_docker (line 323) | def run_h2ogpt_docker(port, base_model, inference_server=None, max_new_t... function test_hf_inference_server (line 381) | def test_hf_inference_server(base_model, force_langchain_evaluate, do_la... function test_openai_inference_server (line 531) | def test_openai_inference_server(inference_server, force_langchain_evalu... function test_gradio_tgi_docker (line 629) | def test_gradio_tgi_docker(base_model): function test_gradio_vllm_docker (line 695) | def test_gradio_vllm_docker(base_model): function test_replicate_inference_server (line 764) | def test_replicate_inference_server(force_langchain_evaluate, FILE: tests/test_iterator_pipe.py class TestQueueToIterator (line 5) | class TestQueueToIterator(unittest.TestCase): method test_normal_iteration (line 7) | def test_normal_iteration(self): method test_normal_custom_sentinel (line 20) | def test_normal_custom_sentinel(self): method test_multiple_close (line 34) | def test_multiple_close(self): method test_multiple_next_after_close (line 50) | def test_multiple_next_after_close(self): method test_put_after_close (line 66) | def test_put_after_close(self): FILE: tests/test_langchain_simple.py function test_langchain_simple_h2ogpt (line 7) | def test_langchain_simple_h2ogpt(): function test_langchain_simple_vicuna (line 13) | def test_langchain_simple_vicuna(): function run_langchain_simple (line 17) | def run_langchain_simple(base_model='h2oai/h2ogpt-oasst1-512-12b', promp... FILE: tests/test_langchain_units.py function test_qa_wiki_openai (line 35) | def test_qa_wiki_openai(): function test_qa_wiki_stuff_hf (line 41) | def test_qa_wiki_stuff_hf(): function test_qa_wiki_map_reduce_hf (line 49) | def test_qa_wiki_map_reduce_hf(): function run_qa_wiki_fork (line 53) | def run_qa_wiki_fork(*args, **kwargs): function run_qa_wiki (line 62) | def run_qa_wiki(use_openai_model=False, first_para=True, text_limit=None... function check_ret (line 78) | def check_ret(ret): function test_qa_wiki_db_openai (line 94) | def test_qa_wiki_db_openai(): function test_qa_wiki_db_hf (line 109) | def test_qa_wiki_db_hf(): function test_qa_wiki_db_chunk_hf (line 128) | def test_qa_wiki_db_chunk_hf(): function test_qa_wiki_db_chunk_openai (line 145) | def test_qa_wiki_db_chunk_openai(): function test_qa_github_db_chunk_openai (line 163) | def test_qa_github_db_chunk_openai(): function test_qa_daidocs_db_chunk_hf (line 181) | def test_qa_daidocs_db_chunk_hf(): function test_qa_daidocs_db_chunk_hf_faiss (line 199) | def test_qa_daidocs_db_chunk_hf_faiss(): function test_qa_daidocs_db_chunk_hf_dbs (line 221) | def test_qa_daidocs_db_chunk_hf_dbs(db_type, top_k_docs): function get_test_model (line 253) | def get_test_model(base_model='h2oai/h2ogpt-oig-oasst1-512-6_9b', function test_qa_daidocs_db_chunk_hf_dbs_switch_embedding (line 314) | def test_qa_daidocs_db_chunk_hf_dbs_switch_embedding(db_type): function test_qa_wiki_db_chunk_hf_dbs_llama (line 366) | def test_qa_wiki_db_chunk_hf_dbs_llama(db_type): function test_qa_daidocs_db_chunk_openai (line 402) | def test_qa_daidocs_db_chunk_openai(): function test_qa_daidocs_db_chunk_openaiembedding_hfmodel (line 419) | def test_qa_daidocs_db_chunk_openaiembedding_hfmodel(): function test_get_dai_pickle (line 436) | def test_get_dai_pickle(): function test_get_dai_db_dir (line 445) | def test_get_dai_db_dir(): function test_make_add_db (line 455) | def test_make_add_db(repeat, db_type): function test_zip_add (line 654) | def test_zip_add(db_type): function test_tar_add (line 679) | def test_tar_add(db_type, tar_type): function test_url_add (line 703) | def test_url_add(db_type): function test_urls_add (line 719) | def test_urls_add(db_type): function test_urls_file_add (line 743) | def test_urls_file_add(db_type): function test_html_add (line 771) | def test_html_add(db_type): function test_docx_add (line 804) | def test_docx_add(db_type): function test_docx_add2 (line 825) | def test_docx_add2(db_type): function test_xls_add (line 848) | def test_xls_add(db_type): function test_md_add (line 869) | def test_md_add(db_type): function test_rst_add (line 894) | def test_rst_add(db_type): function test_xml_add (line 915) | def test_xml_add(db_type): function test_eml_add (line 936) | def test_eml_add(db_type): function test_simple_eml_add (line 956) | def test_simple_eml_add(db_type): function test_odt_add (line 989) | def test_odt_add(db_type): function test_pptx_add (line 1009) | def test_pptx_add(db_type): function test_pdf_add (line 1035) | def test_pdf_add(db_type, enable_pdf_ocr, enable_pdf_doctr, use_pymupdf,... function test_image_pdf_add (line 1112) | def test_image_pdf_add(db_type, enable_pdf_ocr, enable_pdf_doctr, use_py... function test_simple_pptx_add (line 1186) | def test_simple_pptx_add(db_type): function test_epub_add (line 1207) | def test_epub_add(db_type): function test_msg_add (line 1231) | def test_msg_add(db_type): function test_png_add (line 1266) | def test_png_add(captions_model, caption_gpu, pre_load_image_audio_model... function run_png_add (line 1309) | def run_png_add(captions_model=None, caption_gpu=False, function check_content_captions (line 1446) | def check_content_captions(docs, captions_model, enable_pix2struct): function check_content_doctr (line 1460) | def check_content_doctr(docs): function check_content_ocr (line 1467) | def check_content_ocr(docs): function check_source (line 1474) | def check_source(docs, test_file1): function test_caption_add (line 1486) | def test_caption_add(image_file, db_type): function test_simple_rtf_add (line 1526) | def test_simple_rtf_add(db_type): function test_url_more_add (line 1564) | def test_url_more_add(db_type): function test_json_add (line 1620) | def test_json_add(db_type): function test_jsonl_gz_add (line 1647) | def test_jsonl_gz_add(db_type): function test_url_more_subunit (line 1671) | def test_url_more_subunit(): function test_many_text (line 1695) | def test_many_text(db_type, num): function test_youtube_audio_add (line 1709) | def test_youtube_audio_add(db_type): function test_youtube_full_add (line 1729) | def test_youtube_full_add(db_type): function test_mp3_add (line 1750) | def test_mp3_add(db_type): function test_mp4_add (line 1769) | def test_mp4_add(db_type): function test_chroma_filtering (line 1795) | def test_chroma_filtering(): function test_merge_docs (line 2011) | def test_merge_docs(data_kind, max_input_tokens): function test_split_and_merge (line 2091) | def test_split_and_merge(): function test_crawl (line 2110) | def test_crawl(): function test_hyde_acc (line 2118) | def test_hyde_acc(): FILE: tests/test_long_context.py function num_tokens_from_string (line 16) | def num_tokens_from_string(string: str, model_name=None) -> int: function make_key (line 29) | def make_key(): function make_value (line 33) | def make_value(): function get_prompt (line 43) | def get_prompt(before, after): function create_long_prompt_with_secret (line 47) | def create_long_prompt_with_secret(prompt_len=None, secret_pos=None, mod... function test_gradio_long_context_uuid_key_value_retrieval (line 87) | def test_gradio_long_context_uuid_key_value_retrieval(base_model, rope_s... function test_huggyllama_transformers_pr (line 163) | def test_huggyllama_transformers_pr(base_model, type, factor): FILE: tests/test_manual_test.py function test_chat_conversation (line 9) | def test_chat_conversation(): function test_upload_one_file (line 29) | def test_upload_one_file(): function test_upload_multiple_file (line 34) | def test_upload_multiple_file(): function test_upload_url (line 39) | def test_upload_url(): function test_upload_arxiv (line 45) | def test_upload_arxiv(): function test_upload_pasted_text (line 51) | def test_upload_pasted_text(): function test_no_db_dirs (line 61) | def test_no_db_dirs(): function test_upload_unsupported_file (line 68) | def test_upload_unsupported_file(): function test_upload_to_UserData_and_MyData (line 73) | def test_upload_to_UserData_and_MyData(): function test_chat_control (line 78) | def test_chat_control(): function test_subset_only (line 83) | def test_subset_only(): function test_add_new_doc (line 89) | def test_add_new_doc(): function test_model_lock (line 95) | def test_model_lock(): function test_async_gradio (line 100) | def test_async_gradio(): function test_stt_gradio (line 106) | def test_stt_gradio(): FILE: tests/test_metrics.py function test_bleurt (line 5) | def test_bleurt(): function test_sacrebleu (line 15) | def test_sacrebleu(): function test_bleu (line 34) | def test_bleu(): function test_squad_v1 (line 47) | def test_squad_v1(): function test_squad_v2 (line 57) | def test_squad_v2(): function test_rougue (line 69) | def test_rougue(): function test_bertscore (line 79) | def test_bertscore(): function test_chrf (line 89) | def test_chrf(): function test_chrfpp (line 101) | def test_chrfpp(): function test_wiki_split (line 113) | def test_wiki_split(): function test_super_glue (line 124) | def test_super_glue(): function test_quip (line 136) | def test_quip(): function test_glue (line 208) | def test_glue(): function test_google_bleu (line 233) | def test_google_bleu(): function test_meteor (line 254) | def test_meteor(): FILE: tests/test_perf_benchmarks.py function test_perf_benchmarks (line 55) | def test_perf_benchmarks(backend, base_model, task, bits, ngpus): function test_plot_results (line 247) | def test_plot_results(): FILE: tests/test_pipeline.py function test_export_copy (line 7) | def test_export_copy(): function test_pipeline1 (line 49) | def test_pipeline1(): function test_pipeline2 (line 86) | def test_pipeline2(): function test_pipeline3 (line 112) | def test_pipeline3(): FILE: tests/test_prompter.py function test_train_prompt (line 24) | def test_train_prompt(prompt_type='instruct', data_point=0): function test_test_prompt (line 30) | def test_test_prompt(prompt_type='instruct', data_point=0): function test_test_prompt2 (line 37) | def test_test_prompt2(prompt_type='human_bot', data_point=0): function get_prompt_from_messages (line 184) | def get_prompt_from_messages(messages, model="mistralai/Mistral-7B-Instr... function get_aquila_prompt (line 201) | def get_aquila_prompt(messages, model_base_name='AquilaChat2-34B-16K', w... function test_prompt_with_context (line 279) | def test_prompt_with_context(prompt_type, system_prompt, chat_conversati... function test_prompt_with_no_context (line 454) | def test_prompt_with_no_context(prompt_type, system_prompt, expected): function test_source (line 481) | def test_source(): function falcon180_format_prompt (line 487) | def falcon180_format_prompt(message, history, system_prompt): function test_falcon180 (line 500) | def test_falcon180(): function test_hf_image_chat_template (line 510) | def test_hf_image_chat_template(): function test_get_llm_history (line 571) | def test_get_llm_history(history, only_text, expected): function test_history_to_context (line 637) | def test_history_to_context(history, system_prompt, model_max_length): FILE: tests/test_requirements.py function get_all_requirements (line 10) | def get_all_requirements(): function get_requirements (line 25) | def get_requirements(req_file="requirements.txt"): function test_requirements (line 50) | def test_requirements(): function get_version (line 98) | def get_version(package, url_pattern=URL_PATTERN): function test_what_latest_packages (line 113) | def test_what_latest_packages(): function test_make_packages (line 132) | def test_make_packages(): FILE: tests/test_sentence_parsing.py function test_get_sentence_stream (line 92) | def test_get_sentence_stream(bot, sentences_expected): function test_get_sentence_no_stream (line 120) | def test_get_sentence_no_stream(bot, sentences_expected): FILE: tests/test_timeout_iterator.py function iter_simple (line 7) | def iter_simple(): function iter_with_sleep (line 12) | def iter_with_sleep(): function iter_with_exception (line 20) | def iter_with_exception(): class TestTimeoutIterator (line 27) | class TestTimeoutIterator(unittest.TestCase): method test_normal_iteration (line 29) | def test_normal_iteration(self): method test_normal_iteration_for_loop (line 39) | def test_normal_iteration_for_loop(self): method test_timeout_block (line 47) | def test_timeout_block(self): method test_timeout_block_for_loop (line 56) | def test_timeout_block_for_loop(self): method test_fixed_timeout (line 64) | def test_fixed_timeout(self): method test_fixed_timeout_for_loop (line 74) | def test_fixed_timeout_for_loop(self): method test_timeout_update (line 82) | def test_timeout_update(self): method test_custom_sentinel (line 95) | def test_custom_sentinel(self): method test_feature_timeout_reset (line 105) | def test_feature_timeout_reset(self): method test_function_set_reset_on_next (line 113) | def test_function_set_reset_on_next(self): method test_iterator_raises_exception (line 123) | def test_iterator_raises_exception(self): method test_interrupt_thread (line 131) | def test_interrupt_thread(self): FILE: tests/test_tokenizer.py function nltkTokenize (line 9) | def nltkTokenize(text): function regTokenize (line 19) | def regTokenize(text): function test_tokenizer1 (line 30) | def test_tokenizer1(): function run_tokenizer1 (line 56) | def run_tokenizer1(prompt): function test_fake_tokenizer (line 87) | def test_fake_tokenizer(): function test_tokenizer_base_model1 (line 100) | def test_tokenizer_base_model1(): function test_tokenizer_base_model2 (line 113) | def test_tokenizer_base_model2(): FILE: tests/test_tts.py function test_sentence_to_wave (line 11) | def test_sentence_to_wave(): function test_generate_speech (line 39) | def test_generate_speech(): function test_full_generate_speech (line 54) | def test_full_generate_speech(): function test_predict_from_text (line 113) | def test_predict_from_text(bot, sentences_expected): FILE: tests/test_ui.py function test_newline_replace (line 5) | def test_newline_replace(): FILE: tests/test_utils.py function test_get_list_or_str (line 28) | def test_get_list_or_str(): function test_stream_popen1 (line 35) | def test_stream_popen1(): function test_stream_popen2 (line 51) | def test_stream_popen2(): function test_stream_python_execution (line 71) | def test_stream_python_execution(capsys): function test_stream_python_execution_empty_lines (line 118) | def test_stream_python_execution_empty_lines(capsys): function test_memory_limit (line 153) | def test_memory_limit(): function test_limited_prompt (line 169) | def test_limited_prompt(instruction, chat_conversation, iinput, context,... function test_reverse_ucurve (line 270) | def test_reverse_ucurve(): function check_gradio (line 294) | def check_gradio(): function test_is_uuid4 (line 300) | def test_is_uuid4(): function test_is_git_hash (line 318) | def test_is_git_hash(): function test_chat_template (line 326) | def test_chat_template(): function test_chat_template_images (line 352) | def test_chat_template_images(): function test_partial_codeblock (line 387) | def test_partial_codeblock(): function test_partial_codeblock2 (line 557) | def test_partial_codeblock2(): function test_extract_code_block_content (line 569) | def test_extract_code_block_content(): function test_repair_json (line 713) | def test_repair_json(method): function test_json_repair_more (line 764) | def test_json_repair_more(): function test_dedup (line 876) | def test_dedup(): function test_handle_json_normal (line 883) | def test_handle_json_normal(): function test_handle_json_schema (line 896) | def test_handle_json_schema(): function test_handle_json_mixed (line 930) | def test_handle_json_mixed(): function test_handle_json_empty (line 956) | def test_handle_json_empty(): function test_handle_json_no_schema (line 961) | def test_handle_json_no_schema(): function test_json_repair_on_string (line 970) | def test_json_repair_on_string(): function test_check_input_type (line 984) | def test_check_input_type(): function test_process_file_list (line 1009) | def test_process_file_list(): function test_process_file_list_extract_frames (line 1039) | def test_process_file_list_extract_frames(): function test_process_youtube (line 1069) | def test_process_youtube(): function test_process_animated_gif (line 1091) | def test_process_animated_gif(): function test_process_animated_gif2 (line 1113) | def test_process_animated_gif2(): function test_process_animated_gif3 (line 1134) | def test_process_animated_gif3(): function test_process_mixed (line 1156) | def test_process_mixed(): function test_update_db (line 1180) | def test_update_db(): function test_encode_chat_template (line 1221) | def test_encode_chat_template(): function test_depth (line 1269) | def test_depth(): function test_schema_to_typed (line 1332) | def test_schema_to_typed(): function test_genai_schema (line 1375) | def test_genai_schema(): function test_genai_schema_more (line 1418) | def test_genai_schema_more(): function test_pymupdf4llm (line 1494) | def test_pymupdf4llm(): function compute_stats (line 1533) | def compute_stats(times_in_seconds): FILE: tests/test_vision.py function test_llava_client2 (line 9) | def test_llava_client2(): function test_llava_client_stream (line 20) | def test_llava_client_stream(): function test_make_image (line 33) | def test_make_image(): function test_change_image (line 40) | def test_change_image(): function test_video_extraction (line 49) | def test_video_extraction(): function test_make_image_playv2 (line 61) | def test_make_image_playv2(): function test_fastfood (line 68) | def test_fastfood(): FILE: tests/utils.py function get_inf_port (line 19) | def get_inf_port(): function get_inf_server (line 29) | def get_inf_server(): function get_mods (line 39) | def get_mods(): function do_skip_test (line 45) | def do_skip_test(name): function wrap_test_forked (line 55) | def wrap_test_forked(func): function run_test (line 77) | def run_test(func, *args, **kwargs): function get_sha (line 81) | def get_sha(value): function get_test_name (line 85) | def get_test_name(): function make_user_path_test (line 91) | def make_user_path_test(): function get_llama (line 109) | def get_llama(llama_type=3): function kill_weaviate (line 140) | def kill_weaviate(db_type): function count_tokens_llm (line 148) | def count_tokens_llm(prompt, base_model='h2oai/h2ogpt-oig-oasst1-512-6_9... function count_tokens (line 160) | def count_tokens(prompt, base_model='h2oai/h2ogpt-oig-oasst1-512-6_9b'): FILE: win_run_app.py function copy_tree (line 35) | def copy_tree(src, dst): function setup_paths (line 44) | def setup_paths(): function _main (line 83) | def _main(): function main (line 148) | def main():