diff --git a/mkdocs.yml b/mkdocs.yml index 6b765d09..fb0fb5f3 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -90,18 +90,20 @@ nav: - OmniModalAgent: "swarms/agents/omni_agent.md" - Idea2Image: "swarms/agents/idea_to_image.md" - swarms.models: - - Overview: "swarms/models/index.md" - - HuggingFaceLLM: "swarms/models/hf.md" - - Anthropic: "swarms/models/anthropic.md" - - OpenAI: "swarms/models/openai.md" - - Fuyu: "swarms/models/fuyu.md" - - Zephyr: "swarms/models/zephyr.md" - - Vilt: "swarms/models/vilt.md" - - Idefics: "swarms/models/idefics.md" - - BingChat: "swarms/models/bingchat.md" - - Kosmos: "swarms/models/kosmos.md" - - Nougat: "swarms/models/nougat.md" - - LayoutLMDocumentQA: "swarms/models/layoutlm_document_qa.md" + - Language: + - Overview: "swarms/models/index.md" + - HuggingFaceLLM: "swarms/models/hf.md" + - Anthropic: "swarms/models/anthropic.md" + - OpenAI: "swarms/models/openai.md" + - Zephyr: "swarms/models/zephyr.md" + - MultiModal: + - Fuyu: "swarms/models/fuyu.md" + - Vilt: "swarms/models/vilt.md" + - Idefics: "swarms/models/idefics.md" + - BingChat: "swarms/models/bingchat.md" + - Kosmos: "swarms/models/kosmos.md" + - Nougat: "swarms/models/nougat.md" + - LayoutLMDocumentQA: "swarms/models/layoutlm_document_qa.md" - swarms.structs: - Overview: "swarms/structs/overview.md" - Workflow: "swarms/structs/workflow.md" diff --git a/swarms/models/base.py b/swarms/models/base.py index d2b01695..6f0e9ecb 100644 --- a/swarms/models/base.py +++ b/swarms/models/base.py @@ -78,3 +78,16 @@ class AbstractModel(ABC): if self.start_time and self.end_time: return self.end_time - self.start_time return 0 + + def metrics(self) -> str: + _sec_to_first_token = self._sec_to_first_token() + _tokens_per_second = self._tokens_per_second() + _num_tokens = self._num_tokens(self.history) + _time_for_generation = self._time_for_generation(self.history) + + return f""" + SEC TO FIRST TOKEN: {_sec_to_first_token} + TOKENS/SEC: {_tokens_per_second} + TOKENS: {_num_tokens} + Tokens/SEC: {_time_for_generation} + """ \ No newline at end of file