Skip to content

Commit

Permalink
Merge branch 'evan/make-macos-version-great-for-the-first-time' of ht…
Browse files Browse the repository at this point in the history
…tps://github.com/LM-Kit/LM-Kit-Maestro into evan/make-macos-version-great-for-the-first-time
  • Loading branch information
BeepBeepBopBop committed Nov 23, 2024
2 parents 90b4937 + 0e81707 commit a1ab810
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 190 deletions.
3 changes: 2 additions & 1 deletion .github/_typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
[files]
extend-exclude = [
"_typos.toml",
"LM-Kit-Maestro/wwwroot/*"
"LM-Kit-Maestro/wwwroot/*",
"LM-Kit-Maestro/Resources/*"
]

6 changes: 3 additions & 3 deletions LM-Kit-Maestro/Handlers/StatefulContentViewHandler.Apple.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ protected override Microsoft.Maui.Platform.ContentView CreatePlatformView()

protected override void ConnectHandler(Microsoft.Maui.Platform.ContentView platformView)
{
platformView.AddGestureRecognizer(new UIContinousGestureRecognizer(Tapped));
platformView.AddGestureRecognizer(new UIContinuousGestureRecognizer(Tapped));
if (OperatingSystem.IsIOSVersionAtLeast(13))
{
platformView.AddGestureRecognizer(new UIHoverGestureRecognizer(OnHover));
Expand Down Expand Up @@ -83,11 +83,11 @@ private void Tapped(UIGestureRecognizer recognizer)
}

// TODO: Move it to the different file
internal class UIContinousGestureRecognizer : UIGestureRecognizer
internal class UIContinuousGestureRecognizer : UIGestureRecognizer
{
private readonly Action<UIGestureRecognizer> action;

public UIContinousGestureRecognizer(Action<UIGestureRecognizer> action)
public UIContinuousGestureRecognizer(Action<UIGestureRecognizer> action)
{
this.action = action;
}
Expand Down
8 changes: 3 additions & 5 deletions LM-Kit-Maestro/LM-Kit-Maestro.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<TargetFrameworks>net9.0;net9.0-android;net9.0-ios;net9.0-maccatalyst</TargetFrameworks>
<TargetFrameworks>net9.0;net9.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-windows10.0.19041.0</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net9.0-tizen</TargetFrameworks> -->
Expand All @@ -20,8 +20,9 @@
<EnableDefaultCssItems>false</EnableDefaultCssItems>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>

<WindowsPackageType>None</WindowsPackageType>
<AssemblyName>Maestro</AssemblyName>
<OutputName>Maestro</OutputName>

<!-- Display name -->
<ApplicationTitle>Maestro</ApplicationTitle>
Expand All @@ -33,12 +34,9 @@
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>

<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">15.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">15.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">24.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
6 changes: 0 additions & 6 deletions LM-Kit-Maestro/Platforms/Android/AndroidManifest.xml

This file was deleted.

11 changes: 0 additions & 11 deletions LM-Kit-Maestro/Platforms/Android/MainActivity.cs

This file was deleted.

16 changes: 0 additions & 16 deletions LM-Kit-Maestro/Platforms/Android/MainApplication.cs

This file was deleted.

6 changes: 0 additions & 6 deletions LM-Kit-Maestro/Platforms/Android/Resources/values/colors.xml

This file was deleted.

17 changes: 0 additions & 17 deletions LM-Kit-Maestro/Platforms/Tizen/Main.cs

This file was deleted.

15 changes: 0 additions & 15 deletions LM-Kit-Maestro/Platforms/Tizen/tizen-manifest.xml

This file was deleted.

10 changes: 0 additions & 10 deletions LM-Kit-Maestro/Platforms/iOS/AppDelegate.cs

This file was deleted.

32 changes: 0 additions & 32 deletions LM-Kit-Maestro/Platforms/iOS/Info.plist

This file was deleted.

16 changes: 0 additions & 16 deletions LM-Kit-Maestro/Platforms/iOS/Program.cs

This file was deleted.

51 changes: 0 additions & 51 deletions LM-Kit-Maestro/Platforms/iOS/Resources/PrivacyInfo.xcprivacy

This file was deleted.

13 changes: 12 additions & 1 deletion LM-Kit-Maestro/Services/LMKitService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ private void BeforeSubmittingPrompt(Conversation conversation)
{
ChatHistory? chatHistory = shouldUseCurrentChatHistory ? conversation.ChatHistory : ChatHistory.Deserialize(conversation.LatestChatHistoryData, _model);

_multiTurnConversation = new MultiTurnConversation(_model, chatHistory)
_multiTurnConversation = new MultiTurnConversation(_model, chatHistory, LMKitConfig.ContextSize)
{
SamplingMode = GetTokenSampling(LMKitConfig),
MaximumCompletionTokens = LMKitConfig.MaximumCompletionTokens,
Expand All @@ -443,6 +443,17 @@ private void BeforeSubmittingPrompt(Conversation conversation)
conversation.LastUsedModelUri = LMKitConfig.LoadedModelUri;
_lastConversationUsed = conversation;
}
else //updating sampling options, if any.
{
//todo: Implement a mechanism to determine whether SamplingMode and MaximumCompletionTokens need to be updated.
_multiTurnConversation.SamplingMode = GetTokenSampling(LMKitConfig);
_multiTurnConversation.MaximumCompletionTokens = LMKitConfig.MaximumCompletionTokens;

if (LMKitConfig.ContextSize != _multiTurnConversation.ContextSize)
{
//todo: implement context size update.
}
}

if (_singleTurnConversation == null)
{
Expand Down

0 comments on commit a1ab810

Please sign in to comment.