Skip to content

Commit

Permalink
Merge pull request #405 from rmusser01/dev
Browse files Browse the repository at this point in the history
Mindmap creation via PlantUML (Utilties tab) + Token counts in conversations
  • Loading branch information
rmusser01 authored Oct 26, 2024
2 parents 05ed3e0 + 71371e0 commit 709c3e7
Show file tree
Hide file tree
Showing 13 changed files with 981 additions and 30 deletions.
2 changes: 1 addition & 1 deletion App_Function_Libraries/Benchmarks_Evaluations/ms_g_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
wait_random_exponential,
)

from App_Function_Libraries.Chat import chat_api_call
from App_Function_Libraries.Chat.Chat_Functions import chat_api_call

#
#######################################################################################################################
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Chat.py
# Chat_Functions.py
# Chat functions for interacting with the LLMs as chatbots
import base64
# Imports
Expand Down Expand Up @@ -27,6 +27,16 @@
#
# Functions:

def approximate_token_count(history):
total_text = ''
for user_msg, bot_msg in history:
if user_msg:
total_text += user_msg + ' '
if bot_msg:
total_text += bot_msg + ' '
total_tokens = len(total_text.split())
return total_tokens

def chat_api_call(api_endpoint, api_key, input_data, prompt, temp, system_message=None):
log_counter("chat_api_call_attempt", labels={"api_endpoint": api_endpoint})
start_time = time.time()
Expand Down
Empty file.
2 changes: 2 additions & 0 deletions App_Function_Libraries/Gradio_Related.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
from App_Function_Libraries.Gradio_UI.Media_edit import create_prompt_clone_tab, create_prompt_edit_tab, \
create_media_edit_and_clone_tab, create_media_edit_tab
from App_Function_Libraries.Gradio_UI.Media_wiki_tab import create_mediawiki_import_tab, create_mediawiki_config_tab
from App_Function_Libraries.Gradio_UI.Mind_Map_tab import create_mindmap_tab
from App_Function_Libraries.Gradio_UI.PDF_ingestion_tab import create_pdf_ingestion_tab, create_pdf_ingestion_test_tab
from App_Function_Libraries.Gradio_UI.Plaintext_tab_import import create_plain_text_import_tab
from App_Function_Libraries.Gradio_UI.Podcast_tab import create_podcast_tab
Expand Down Expand Up @@ -384,6 +385,7 @@ def launch_ui(share_public=None, server_mode=False):
# FIXME
#create_anki_generation_tab()
create_anki_validation_tab()
create_mindmap_tab()
create_utilities_yt_video_tab()
create_utilities_yt_audio_tab()
create_utilities_yt_timestamp_tab()
Expand Down
Loading

0 comments on commit 709c3e7

Please sign in to comment.