MCPcopy Create free account

hub / github.com/AdamSobieszek/langtorch / functions

Functions413 in github.com/AdamSobieszek/langtorch

↓ 56 callersMethoditems
Retrieves key-value pairs from the Text object, allowing for structured data extraction and further processing. Returns:
src/langtorch/texts/text.py:246
↓ 45 callersMethodreshape
(self, *shape)
src/langtorch/tensors/texttensor.py:910
↓ 22 callersMethodkeys
(self)
src/langtorch/texts/text.py:257
↓ 16 callersMethodformat
(self, *args, **kwargs)
src/langtorch/texts/text.py:687
↓ 15 callersMethodsplit
(self, sep=" ", mode="auto")
src/langtorch/texts/text.py:498
↓ 11 callersMethoditem
(self)
src/langtorch/tensors/texttensor.py:733
↓ 11 callersFunctionmax
(input: TextTensor, definition: str = "the text that stands out as the best, most helpful and relevant
src/langtorch/semantic_algebra.py:46
↓ 11 callersMethodsum
Reduces the input tensor over the specified dimensions, optionally keeping dimensions.
src/langtorch/tensors/texttensor.py:658
↓ 10 callersMethodvalues
(self)
src/langtorch/texts/text.py:260
↓ 9 callersMethoditems
Get (key, value) pairs from all Text entries in tensors
src/langtorch/tensors/texttensor.py:736
↓ 9 callersMethodunsqueeze
(tensor, dim=0)
src/langtorch/tensors/texttensor.py:913
↓ 8 callersMethodadd_key_
(self, keys)
src/langtorch/texts/text.py:327
↓ 8 callersMethodapply
Applies a function: Text -> Text to each entry of self.content
src/langtorch/tensors/texttensor.py:550
↓ 7 callersMethodapply
(self, func, *args, to="values", **kwargs)
src/langtorch/texts/text.py:717
↓ 6 callersMethodcopy
(self)
src/langtorch/tensors/texttensor.py:646
↓ 6 callersMethodset_key
Override keys for the textual entries, used for restructuring the content. Useful for substituting the key right before passing TextT
src/langtorch/texts/text.py:263
↓ 6 callersFunctionto_ast
Reformats a wide array of construtor patterns into a unified AST-like format
src/langtorch/grammars/text_content_ast.py:18
↓ 6 callersMethodview
(self, *shape)
src/langtorch/tensors/texttensor.py:976
↓ 5 callersFunctioneval_dataset
(test_set, eval_fn, model, max_samples: int = None)
evaluation/prompt_optimization.py:52
↓ 5 callersFunctionmin
(input: TextTensor, definition: str = "the text that stands out as incorrect, least complete or of the
src/langtorch/semantic_algebra.py:74
↓ 5 callersMethodsave
(self, path=None)
src/langtorch/session.py:115
↓ 5 callersMethodset_key
(self, keys=None, inplace=False)
src/langtorch/tensors/texttensor.py:502
↓ 5 callersMethodstr_formatter
Formats the human-readable string of a Text instance. Subclasses of Text can reimplement this method! Args: instance (Te
src/langtorch/texts/text.py:128
↓ 5 callersMethodttype
(self)
src/langtorch/tensors/texttensor.py:320
↓ 4 callersMethod_join_key_value
Concatenates parsed text elements, handling spaces and formatting.
src/langtorch/texts/text.py:773
↓ 4 callersMethodexpand
(tensor, *sizes)
src/langtorch/tensors/texttensor.py:930
↓ 4 callersMethodload
(self, path=None, override=False, **kwargs)
src/langtorch/session.py:89
↓ 4 callersFunctionsum
(input: TextTensor, *args, **kwargs)
src/langtorch/_VariableFunctions.py:204
↓ 3 callersFunctionappend_text_labels
Formats the input by adding labels based on the specified dimensions.
src/langtorch/semalg_utils.py:12
↓ 3 callersFunctionchararray_to_TextArray
(arr, ttype=Text, shape=None, **kwargs)
src/langtorch/tensors/texttensor.py:29
↓ 3 callersMethodembed
(self, model=None, verbose=False)
src/langtorch/tensors/texttensor.py:886
↓ 3 callersFunctionformat_2d
(array_2d, max_width=200, wrap_text=False, indent=" ", spacing=2)
src/langtorch/grammars/formatters.py:86
↓ 3 callersFunctionis_Text
(obj)
src/langtorch/utils.py:34
↓ 3 callersFunctionis_TextTensor
(obj)
src/langtorch/utils.py:42
↓ 3 callersMethodmetadata_apply
Apply a specified function to a copy of metadata elements of the TextTensor. Parameters: - f_tensor (function, optional): Fu
src/langtorch/tensors/texttensor.py:598
↓ 3 callersMethodrequest
(self, provider, type, request_strings, cache=True)
src/langtorch/session.py:168
↓ 2 callersMethod__init__
(self, model: Union[str, TextTensor] = "gpt-3.5-turbo", system_message: Unio
src/langtorch/tt/modules/to_tt/activation.py:165
↓ 2 callersMethod__iter__
(self)
src/langtorch/texts/text.py:525
↓ 2 callersMethod_activation_backward
(variables: List[Variable], response: Variable, prom
src/langtorch/autograd/backward_activation.py:27
↓ 2 callersMethod_conv_forward
(self, input: TextTensor, weight: TextTensor, bias: Optional[TextTensor])
src/langtorch/tt/modules/to_tt/conv.py:264
↓ 2 callersMethodadd_key
(self, keys, inplace=False)
src/langtorch/tensors/texttensor.py:529
↓ 2 callersMethodadd_key
Add a top-level key, placing the items of the original as a value under the new key. Useful for working with nested keys like in Cha
src/langtorch/texts/text.py:296
↓ 2 callersMethodadd_response
(self, id, response)
src/langtorch/session.py:197
↓ 2 callersFunctionapi_endpoint_from_url
Extract the API endpoint from the request URL.
src/langtorch/api/parallel_processor_utils.py:122
↓ 2 callersMethodcall_api
Required method for calling the API.
src/langtorch/api/parallel_processor_utils.py:56
↓ 2 callersMethodcompletions
(self, type, provider, request_strings, key=None)
src/langtorch/session.py:215
↓ 2 callersMethodcontent_to_object_array
(cls, input, **kwargs)
src/langtorch/tensors/texttensor.py:210
↓ 2 callersMethodcpu
(self)
src/langtorch/types.py:43
↓ 2 callersMethoddetach
(self)
src/langtorch/tensors/texttensor.py:462
↓ 2 callersFunctionexecute_api_requests_in_parallel
( ids: list, request_strings: list, request_url: str, request_header: dict,
src/langtorch/api/api_threading.py:6
↓ 2 callersFunctionformat_1d_as_row
(array_1d, column_limit=200, wrap_text=False)
src/langtorch/grammars/formatters.py:121
↓ 2 callersMethodfrom_messages
Text from a list of dicts with keys 'role' and 'content
src/langtorch/texts/text.py:145
↓ 2 callersMethodgenerate
(activation, inputs, system_messages)
src/langtorch/tt/modules/to_tt/activation.py:133
↓ 2 callersMethodgetitem_over_metadata
Pick out entries of metadata with the provided index. Usually used to transfer metadata to a sub-tensors.
src/langtorch/tensors/texttensor.py:584
↓ 2 callersFunctionis_terminal_node
(entry)
src/langtorch/grammars/text_content_ast.py:113
↓ 2 callersMethodload
(cls, path: str, encoding="utf-8", parse: Union[bool, str] = True)
src/langtorch/texts/text.py:826
↓ 2 callersMethodmethod_apply
(self, method: str, *args, to="values", **kwargs)
src/langtorch/texts/text.py:706
↓ 2 callersMethodnumpy
(self)
src/langtorch/tensors/texttensor.py:479
↓ 2 callersFunctionpandoc_dict_to_tuple
(d)
src/langtorch/grammars/pandoc.py:99
↓ 2 callersFunctionprocess_line
(line, max_width, wrap_text)
src/langtorch/grammars/formatters.py:69
↓ 2 callersMethodsqueeze
(tensor, dim=None)
src/langtorch/tensors/texttensor.py:916
↓ 2 callersFunctionstack
r""" stack(texttensors, dim=0, *, out=None) -> Tensor Concatenates a sequence of tensors along a new dimension. All tensors need to be of t
src/langtorch/_VariableFunctions.py:42
↓ 2 callersFunctiontask_id_generator_function
Generate integers 0, 1, 2, and so on.
src/langtorch/api/parallel_processor_utils.py:139
↓ 2 callersMethodto
Removes the effects of the method from TextTensors, applies the method to embedding and/or token tensors
src/langtorch/tensors/texttensor.py:470
↓ 2 callersMethodto_list
(self)
src/langtorch/tensors/texttensor.py:697
↓ 2 callersMethodtokenizer
(self)
src/langtorch/tensors/texttensor.py:278
↓ 2 callersMethodupper
(self)
src/langtorch/texts/text.py:729
↓ 1 callersMethod__eq__
(self, other)
src/langtorch/tensors/texttensor.py:652
↓ 1 callersMethod__getattr__
(self, name)
src/langtorch/session.py:274
↓ 1 callersMethod__init__
(self, model, reshape=True, key=None, **model_kwargs)
src/langtorch/decorators.py:64
↓ 1 callersMethod__init__
Base class for all text optimizers. Args: params (iterable): an iterable of :class:`torch.Tensor` s or :class:`dict` s. Speci
src/langtorch/optim/optimizer.py:8
↓ 1 callersMethod__init__
(self, activation=None, key=None)
src/langtorch/methods/chain_of_thought.py:7
↓ 1 callersMethod__init__
(self, prompt: TextTensor, activation=None, key="loss", reduction: str = 'sum')
src/langtorch/tt/modules/to_tt/loss.py:16
↓ 1 callersMethod__init__
( self, weight: TextTensor, in_channels: int, out_channels: in
src/langtorch/tt/modules/to_tt/conv.py:240
↓ 1 callersMethod__mul__
(self, other)
src/langtorch/texts/text.py:559
↓ 1 callersMethod__new__
(cls, content="", parse=True, metadata=None, ttype: Text = None, embedding_mod
src/langtorch/tensors/texttensor.py:97
↓ 1 callersMethod__new__
(cls, *args, parse=True, **kwargs)
src/langtorch/tensors/markdowntensor.py:8
↓ 1 callersMethod__str__
(self)
src/langtorch/session.py:319
↓ 1 callersMethod__str__
(self)
src/langtorch/tensors/texttensor.py:639
↓ 1 callersMethod_add_message
(self, user_message, role="user")
src/langtorch/tt/modules/to_tt/assistantmodule.py:48
↓ 1 callersFunction_calculate_shape
(output: torch.Tensor, grad: torch.Tensor, is_grads_batched: bool)
src/langtorch/autograd/autograd.py:122
↓ 1 callersMethod_construct_prompt
(instruction_chain, backward_info)
src/langtorch/autograd/backward_activation.py:19
↓ 1 callersMethod_dict_to_tt
(cls, d, parse)
src/langtorch/tensors/texttensor.py:183
↓ 1 callersMethod_execute_code_serial
(self, code_entry, namespace_entry)
src/langtorch/tensors/codetensor.py:53
↓ 1 callersMethod_get_response
(self, run)
src/langtorch/tt/modules/to_tt/assistantmodule.py:61
↓ 1 callersMethod_handle_functions_on_embeddings
Substitutes the TextTensor entries with their embeddings and applies the function.
src/langtorch/tensors/texttensor.py:368
↓ 1 callersMethod_handle_functions_on_texts
(self, func: Callable, *args, **kwargs)
src/langtorch/tensors/texttensor.py:361
↓ 1 callersMethod_handle_functions_on_tokens
(self, func: Callable, *args, **kwargs)
src/langtorch/tensors/texttensor.py:410
↓ 1 callersMethod_parse_elements
Recursively parses Pandoc AST elements into a list of tuples.
src/langtorch/texts/text.py:745
↓ 1 callersMethod_recursive_walk_replace
Recursively walks through any iterable structure, finds all instances of target_class, and replaces them with the result of func appl
src/langtorch/tensors/texttensor.py:160
↓ 1 callersMethod_run
(self)
src/langtorch/tt/modules/to_tt/assistantmodule.py:54
↓ 1 callersFunction_unbroadcast_gradients
(input_grad, tensor1, tensor2, gradient_equation=(lambda grad, t1, t2: (grad, grad)), sep="")
src/langtorch/tt/functional.py:36
↓ 1 callersMethod_update_prompt
(self, param)
src/langtorch/optim/optimizer.py:97
↓ 1 callersMethod_wait_on_run
(self, run)
src/langtorch/tt/modules/to_tt/assistantmodule.py:78
↓ 1 callersMethodbackward
(ctx, grad_output)
src/langtorch/tt/functional.py:374
↓ 1 callersFunctionblock_to_markdown
(cls, entry: Union[str, Tuple[str, Union[str, List]]])
src/langtorch/grammars/utils.py:5
↓ 1 callersFunctionchat
Processes a list of chat prompts in parallel, saving the results to a specified file. Parameters: prompts (List[str] or List[Tuple[s
src/langtorch/api/call.py:155
↓ 1 callersFunctionchat_strings
Prepares a list of chat strings in JSON format for batch processing. Each string represents a separate chat prompt for the OpenAI API.
src/langtorch/api/call.py:98
↓ 1 callersFunctioncheck_for_lists
(tree)
src/langtorch/grammars/text_content_ast.py:89
↓ 1 callersFunctionconfig
()
evaluation/prompt_optimization.py:20
next →1–100 of 413, ranked by callers