Skip to content

zostaw/martha

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Martha

Simple demonstration of Function Calling in local LLM model.
It's commandline chat interface to model.
It uses a simple prompt to guide assistant to teach you python and when code is suggested, it can be evaluated directly in chat.
The program stores history of conversation.

Supported format: GGUF

Usage

  1. Download LLM chat model, i.e. OpenHermes 2.5 Mistral 7B from Hugging Face.

  2. Adjust model path in martha.py (by default it's looking under: ./models/openhermes-2.5-mistral-7b-16k.Q5_K_M.gguf)

  3. Execute:

./martha.py

Begin conversation...

user:

Example conversation

In below example bold statements are written by user, the rest (including provided code and output) is output of the program.

Conversation

user: What are list comprehensions?
assistant: List comprehensions are a concise way to create lists in Python by combining a loop and a conditional statement into a single line of code. They provide an efficient and readable way to generate new lists based on existing lists or other iterable objects. Here's an example:

# Original list
original_list = [1, 2, 3, 4, 5, 6]

# List comprehension to double each element in the list
doubled_list = [num * 2 for num in original_list]
print("Original list:", original_list)  # Original list: [1, 2, 3, 4, 5, 6]
print("Doubled list:", doubled_list)  # Doubled list: [2, 4, 6, 8, 10, 12]

In this example, we create a new list called doubled_list by multiplying each element of original_list by 2 using a list comprehension. The syntax is [expression for item in iterable], where expression is the operation you want to perform on each item and iterable is the list or other iterable object you're operating on.
Do you want to execute the code (y/n)? y
Output:

Original list: [1, 2, 3, 4, 5, 6]
Doubled list: [2, 4, 6, 8, 10, 12]

About

Simple demonstration of function calling in locally run LLM chat model.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages