Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/discus-labs/discus
/ functions
Functions
43 in github.com/discus-labs/discus
⨍
Functions
43
◇
Types & classes
11
↓ 1 callers
Method
_get_data_from_model_response
(self, response)
src/discus/models/huggingface.py:63
↓ 1 callers
Method
_hf_generate
(self, prompt, context = None)
src/discus/models/huggingface.py:14
↓ 1 callers
Method
_load_data
Load data from the CSV file.
src/discus/generator.py:65
↓ 1 callers
Method
_openai_generate
(self, prompt, context = None)
src/discus/models/openai.py:16
↓ 1 callers
Method
_parse_config
Parse the JSON config file.
src/discus/json/config.py:36
↓ 1 callers
Method
_set_attributes
Set instance variables using keys from config data. Raise an error if a key is missing.
src/discus/json/config.py:12
↓ 1 callers
Method
_validate_config
Validates the config against supported models and task types.
src/discus/generator.py:20
↓ 1 callers
Method
extract_data
TODO: add docstring
src/discus/knowledge.py:34
↓ 1 callers
Method
generate_prompt
(self, seed_dataset: pd.DataFrame = None, context = None)
src/discus/operations/instruction.py:9
↓ 1 callers
Method
generate_prompt
(self, seed_dataset: pd.DataFrame = None, context = None)
src/discus/operations/instance.py:9
↓ 1 callers
Function
retrieve_supported_embedding_models
Generate given model providers. This function retrieves the list of embedding model providers from SupportedEmbeddingModels enum.
src/discus/json/architecture.py:11
↓ 1 callers
Function
retrieve_supported_models
Generate given model providers. This function retrieves the list of model providers from SupportedModels enum.
src/discus/json/architecture.py:4
↓ 1 callers
Function
retrieve_task_types
Generate given task types. This function retrieves the list of acceptable task_types from TaskType enum.
src/discus/json/architecture.py:18
↓ 1 callers
Method
transform_dataframe
Transforms a DataFrame into a list of dictionaries. Parameters: df (pandas.DataFrame): The DataFrame to be transformed.
src/discus/operations/instruction.py:59
↓ 1 callers
Method
transform_dataframe
Transforms a DataFrame into a list of dictionaries. Parameters: df (pandas.DataFrame): The DataFrame to be transformed.
src/discus/operations/instance.py:59
Method
__init__
Initializes Knowledge class with config
src/discus/knowledge.py:18
Method
__init__
Initialize the generator and parse the config.
src/discus/generator.py:15
Method
__init__
Initialize the Dataset with a given CSV file path.
src/discus/datasets/dataset.py:8
Method
__init__
(self, config: DiscusConfig)
src/discus/models/openai.py:9
Method
__init__
(self, config: DiscusConfig)
src/discus/models/huggingface.py:8
Method
__init__
(self, config_path: str)
src/discus/json/config.py:8
Method
__init__
(self, config: DiscusConfig)
src/discus/operations/instruction.py:6
Method
__init__
(self, config: DiscusConfig)
src/discus/operations/instance.py:6
Method
__len__
Return the number of examples in the dataset.
src/discus/datasets/dataset.py:168
Method
__repr__
Return a string representation of the dataset.
src/discus/datasets/dataset.py:172
Method
_get_data_from_model_response
(self, response)
src/discus/models/openai.py:57
Method
_load_data
Load data from the CSV file.
src/discus/datasets/dataset.py:12
Method
_validate_config
Validates the config against supported models and task types.
src/discus/knowledge.py:28
Method
chunk_data
chunk_proporition is proportion of context window overlap is proportion of chunk which overlaps with the next path - a path t
src/discus/knowledge.py:70
Method
cleaning
Include shnu's cleaning function for datasets.
src/discus/datasets/dataset.py:160
Function
complete_instances
Generate completions for a list of input instances using contextual information and OpenAI's chat model. This function takes a list of input
src/discus/knowledge_old.py:123
Function
create_vector_store
Create a vector store from text documents using OpenAI embeddings. This function reads text documents from a specified path, processes them
src/discus/knowledge_old.py:13
Method
elements_below_similarity_threshold
Filters elements based on a similarity threshold using TF-IDF cosine similarity. This function takes either a list of text inputs or
src/discus/datasets/dataset.py:97
Method
generate_embeddings
(self, collection_name, persist_path)
src/discus/knowledge.py:117
Function
generate_prompts
Generate a comprehensive list of prompts based on text documents and OpenAI's chat model. This function reads text documents from a specifie
src/discus/knowledge_old.py:195
Method
get_data
Return the loaded dataset.
src/discus/datasets/dataset.py:164
Method
load_db
(self, collection_name, persist_path)
src/discus/knowledge.py:146
Function
load_vector_store
Load a Chroma vector store from a specified path. This function loads a previously created Chroma vector store from the specified path and r
src/discus/knowledge_old.py:50
Method
n_most_unique_elements
Extracts the n most unique elements from a list of text inputs or a DataFrame. This function takes either a list of text inputs or a
src/discus/datasets/dataset.py:20
Method
naive_retriever
(self, k=3)
src/discus/knowledge.py:169
Function
query_vector_store
Query a Chroma vector store for relevant documents and generate a response using OpenAI's chat model. This function queries a Chroma vector
src/discus/knowledge_old.py:71
Method
retriever
(self, query)
src/discus/knowledge.py:176
Method
run
Load seed dataset and generate the synthetic dataset based on the parsed config.
src/discus/generator.py:29