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

Can't find LLamaSharpModelInstruction in getting started example #362

Open
markat1 opened this issue Jun 29, 2024 · 0 comments
Open

Can't find LLamaSharpModelInstruction in getting started example #362

markat1 opened this issue Jun 29, 2024 · 0 comments
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@markat1
Copy link

markat1 commented Jun 29, 2024

Describe the bug

I tried your example in Getting-started

I'm getting a CS0103 compiler error - it can't find LLamaSharpModelInstruction

Error (active) CS0103 The name 'LLamaSharpModelInstruction' does not exist in the current context

So is it because 'LLamaSharpModelInstruction' is called something else now?

Steps to reproduce the bug

  1. created a .net 8 console app
  2. installed Langchain, llamacharp.Backend
  <ItemGroup>
    <PackageReference Include="LangChain" Version="0.15.0" />
    <PackageReference Include="LLamaSharp.Backend.Cpu" Version="0.13.0" />
    <PackageReference Include="LLamaSharp.Backend.Cuda11" Version="0.13.0" />
    <PackageReference Include="LLamaSharp.Backend.Cuda12" Version="0.13.0" />
  </ItemGroup>

  1. added following code:
using LangChain.Chains;
using LangChain.Providers.Downloader;
using LangChain.Providers.HuggingFace.Downloader;
using LangChain.Providers.LLamaSharp;


// get model path
var modelPath = await HuggingFaceModelDownloader.Instance.GetModel("TheBloke/Thespis-13B-v0.5-GGUF", "thespis-13b-v0.5.Q2_K.gguf", "main");

// load model
var model = LLamaSharpModelInstruction.FromPath(modelPath);
model.PromptSent += Console.Write;
model.TokenGenerated += Console.Write;


// building a chain
var prompt = @"
You are an AI assistant that greets the world.
World: Hello, Assistant!
Assistant:";

var chain =
    Chain.Set(prompt, outputKey: "prompt")
    | Chain.LLM(model, inputKey: "prompt");

chain.Run().Wait();

Expected behavior

I can compile and run the console app.

Screenshots

image

image

NuGet package version

   <PackageReference Include="LangChain" Version="0.15.0" />
    <PackageReference Include="LLamaSharp.Backend.Cpu" Version="0.13.0" />
    <PackageReference Include="LLamaSharp.Backend.Cuda11" Version="0.13.0" />
    <PackageReference Include="LLamaSharp.Backend.Cuda12" Version="0.13.0" />
@markat1 markat1 added the bug Something isn't working label Jun 29, 2024
@HavenDV HavenDV added the documentation Improvements or additions to documentation label Jun 29, 2024
@markat1 markat1 changed the title Bug title Can't find LLamaSharpModelInstruction Jun 29, 2024
@markat1 markat1 changed the title Can't find LLamaSharpModelInstruction Can't find LLamaSharpModelInstruction in getting started example Jun 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants