Skip to content

Commit

Permalink
adapt unit tests for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
amakropoulos committed Dec 18, 2024
1 parent b14f614 commit 1eebde2
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions Tests/Runtime/TestLLM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@ static TestRunListener()

public class TestRunCallbacks : ICallbacks
{
public void RunStarted(ITestAdaptor testsToRun){}
public void RunStarted(ITestAdaptor testsToRun) { }

public void RunFinished(ITestResultAdaptor result)
{
LLMUnitySetup.FullLlamaLib = false;
}

public void TestStarted(ITestAdaptor test) {
public void TestStarted(ITestAdaptor test)
{
LLMUnitySetup.FullLlamaLib = test.FullName.Contains("CUDA_full");
}

Expand Down Expand Up @@ -262,7 +263,7 @@ public async Task RunTestsTask()
await Tests();
llm.OnDestroy();
}
catch (Exception e)
catch (Exception e)
{
error = e;
}
Expand Down Expand Up @@ -299,7 +300,7 @@ public void TestInitParameters(int nkeep, int chats)

public void TestTokens(List<int> tokens)
{
Assert.AreEqual(tokens, new List<int> {40});
Assert.AreEqual(tokens, new List<int> { 40 });
}

public void TestWarmup()
Expand All @@ -323,7 +324,7 @@ public void TestEmbeddings(List<float> embeddings)
Assert.That(embeddings.Count == 896);
}

public virtual void OnDestroy() {}
public virtual void OnDestroy() { }
}

public class TestLLM_LLMManager_Load : TestLLM
Expand Down Expand Up @@ -543,12 +544,20 @@ public class TestLLM_CUDA_full : TestLLM_CUDA
public override void SetParameters()
{
base.SetParameters();
reply1 = "To increase your meme production output, you might consider using more advanced tools and techniques to generate memes faster";
reply2 = "To increase your meme production output, you might consider using more advanced tools and techniques to generate memes faster";
if (Application.platform == RuntimePlatform.WindowsEditor || Application.platform == RuntimePlatform.WindowsPlayer)
{
reply1 = "To increase your meme production output, you might consider using more modern tools and techniques to generate memes.";
reply2 = "To increase your meme production output, you can try using various tools and techniques to generate more content quickly";
}
else
{
reply1 = "To increase your meme production output, you might consider using more advanced tools and techniques to generate memes faster";
reply2 = "To increase your meme production output, you might consider using more advanced tools and techniques to generate memes faster";
}
}
}

public class TestLLM_CUDA_full_attention : TestLLM_CUDA
public class TestLLM_CUDA_full_attention : TestLLM_CUDA_full
{
public override LLM CreateLLM()
{
Expand All @@ -560,8 +569,10 @@ public override LLM CreateLLM()
public override void SetParameters()
{
base.SetParameters();
reply1 = "To increase your meme production output, you might consider using more advanced tools and techniques to generate memes faster";
reply2 = "To increase your meme production output, you can try using various tools and techniques to generate more memes.";
if (Application.platform == RuntimePlatform.LinuxEditor || Application.platform == RuntimePlatform.LinuxPlayer)
{
reply2 = "To increase your meme production output, you can try using various tools and techniques to generate more memes.";
}
}
}
}

0 comments on commit 1eebde2

Please sign in to comment.