Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: LLamaSharp.Backend not added as reference #849

Open
MiriamLaube opened this issue Jul 12, 2024 · 3 comments
Open

[BUG]: LLamaSharp.Backend not added as reference #849

MiriamLaube opened this issue Jul 12, 2024 · 3 comments

Comments

@MiriamLaube
Copy link

Description

I try to run the example for LLamasharp. At the moment I just got

using LLama.Common;
using LLama;
using LLama.Native;

string modelPath = @"C:\dev\llama-2-7b-chat.Q4_K_M.gguf";

try
{
unsafe
{
var parameters = new ModelParams(modelPath)
{
ContextSize = 1024, // The longest length of chat as memory.
GpuLayerCount = 5 // How many layers to offload to GPU. Please adjust it according to your GPU memory.
};
}
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}

I use .net Framework 4.8.
Installing LLamaSharp worked just fine. But when I try to install LLamaSharp.Backend.Cuda12 or LLamaSharp.Backend.Cpu(installed one at a time) the package istn't included in the references. I tried reinstalling it multiple times and I can't execute NativeLibraryConfig.Instance.WithLogs(); either because it says "Severity Code Description Project File Line Suppression State Error (active) CS1061 'NativeLibraryConfigContainer' does not contain a definition for 'WithLogs' and no accessible extension method 'WithLogs' accepting a first argument of type 'NativeLibraryConfigContainer' could be found (are you missing a using directive or an assembly reference?)"

I also downloaded the repo and it worked just fine. I guess there is an error on my side but I just don't know what to do anymore.

Reproduction Steps

  1. Install LLamaSharp package
  2. Install a LLamaSharp.Backend package
  3. LLamaSharp.Backend isnt included in references (LlamaSharp is)

Environment & Configuration

  • Operating system:
  • .NET runtime version:
  • LLamaSharp version:
  • CUDA version (if you are using cuda backend):
  • CPU & GPU device:

Known Workarounds

No response

@MiriamLaube
Copy link
Author

I just tried my code for the .net 8. I hda no problem with this version. So I guess it really is the .netFramework4.8

@SignalRT
Copy link
Collaborator

Could you share your project.csproj to see the references and framework?

@MiriamLaube
Copy link
Author

Sorry for the late reply.
This is my projects csproj:
csproj

I added the projects properties just in case:
properties

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants