mirror of
https://github.com/wolfpld/tracy.git
synced 2026-09-06 18:38:28 +00:00
Hook up LLM window.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include <ollama.hpp>
|
||||
|
||||
#include "TracyConfig.hpp"
|
||||
#include "TracyImGui.hpp"
|
||||
#include "TracyLlm.hpp"
|
||||
|
||||
extern tracy::Config s_config;
|
||||
@@ -68,4 +69,13 @@ size_t TracyLlm::GetCtxSize( const std::string& model ) const
|
||||
}
|
||||
}
|
||||
|
||||
void TracyLlm::Draw()
|
||||
{
|
||||
const auto scale = GetScale();
|
||||
ImGui::SetNextWindowSize( ImVec2( 400 * scale, 800 * scale ), ImGuiCond_FirstUseEver );
|
||||
ImGui::Begin( "Tracy AI", &m_show, ImGuiWindowFlags_NoScrollbar );
|
||||
if( ImGui::GetCurrentWindowRead()->SkipItems ) { ImGui::End(); return; }
|
||||
ImGui::End();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -21,6 +21,10 @@ public:
|
||||
[[nodiscard]] std::vector<std::string> GetModels() const;
|
||||
[[nodiscard]] size_t GetCtxSize( const std::string& model ) const;
|
||||
|
||||
void Draw();
|
||||
|
||||
bool m_show = false;
|
||||
|
||||
private:
|
||||
std::unique_ptr<Ollama> m_ollama;
|
||||
|
||||
|
||||
@@ -957,6 +957,11 @@ bool View::DrawImpl()
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
}
|
||||
if( m_llm.IsValid() )
|
||||
{
|
||||
ImGui::SameLine();
|
||||
ToggleButton( ICON_FA_ROBOT, m_llm.m_show );
|
||||
}
|
||||
if( m_worker.AreFramesUsed() )
|
||||
{
|
||||
ImGui::SameLine();
|
||||
@@ -1151,6 +1156,7 @@ bool View::DrawImpl()
|
||||
if( m_sampleParents.symAddr != 0 ) DrawSampleParents();
|
||||
if( m_showRanges ) DrawRanges();
|
||||
if( m_showWaitStacks ) DrawWaitStacks();
|
||||
if( m_llm.m_show ) m_llm.Draw();
|
||||
|
||||
if( m_setRangePopup.active )
|
||||
{
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "TracyBuzzAnim.hpp"
|
||||
#include "TracyConfig.hpp"
|
||||
#include "TracyDecayValue.hpp"
|
||||
#include "TracyLlm.hpp"
|
||||
#include "TracySourceContents.hpp"
|
||||
#include "TracyTimelineController.hpp"
|
||||
#include "TracyUserData.hpp"
|
||||
@@ -936,6 +937,8 @@ private:
|
||||
lastTime = 0;
|
||||
}
|
||||
} m_flameGraphInvariant;
|
||||
|
||||
TracyLlm m_llm;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user