llamafile-completion-example

command module
v0.0.0-...-e5f2120 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2024 License: MIT Imports: 4 Imported by: 0

README ยถ

LlamaFile Completion Example

Welcome to this cheerful example of using LlamaFile for text completion with LangChain Go! ๐ŸŽ‰

What This Example Does

This fun little program demonstrates how to use the LlamaFile model to generate text completions. Here's what it does:

  1. ๐Ÿš€ Sets up a LlamaFile model with custom options:

    • Uses an embedding size of 2048
    • Sets the temperature to 0.8 for more creative outputs
  2. ๐Ÿง  Prepares a simple question: "Brazil is a country? answer yes or no"

  3. ๐Ÿ”ฎ Sends the question to the LlamaFile model for completion

  4. ๐Ÿ“บ Streams the generated response, printing it to the console as it's received

How to Run

  1. Make sure you have Go installed on your system
  2. Clone the repository and navigate to this example's directory
  3. Run the example with go run llamafile_completion_example.go

What to Expect

When you run this example, you'll see the LlamaFile model's response to the question about Brazil streamed to your console. The answer should be a simple "yes" or "no", but remember that with the temperature set to 0.8, there might be some variation or additional context in the response!

Have fun exploring language models with this example! ๐ŸŽˆ๐Ÿค–

Documentation ยถ

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL