GithubHelp home page GithubHelp logo

tchlux / roanoke-slm-workshop Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 2.04 MB

Code and files for the Roanoke College Small Language Model (SLM) workshop in January 2024.

License: MIT License

Python 100.00%

roanoke-slm-workshop's Introduction

workshop banner

Living Code Workshop: SLMs in Python

Overview

Welcome to our GitHub repository, designed for the Roanoke College computer science department Living Code Workshop (slides)! This repository showcases the capabilities of small language models, demonstrating how they can be effectively used in various applications. Our Python script we wrote in the workshop provides a glimpse into the world of AI-driven text generation, parsing, and interaction.

Features

  • Language Model Integration: Utilizes small language models for generating text, answering questions, and more.
  • Customizable Grammars: Implements Llama grammars for constrained outputs, ensuring relevance and precision.
  • Real-time Demonstrations: Includes live examples to illustrate the use of language models in practical scenarios.

Set Up

Clone this repository to your local machine using the following command:

git clone https://github.com/tchlux/roanoke-slm-workshop

To run the script, you will need to install the llama-cpp-python library. You can do this using pip:

python3 -m pip install --user llama-cpp-python

Then download your favorite small language model (examples below) and put it into this directory for easy access. For optimal performance, we recommend using one of the following models:

  1. Mistral Instruct: A versatile model suitable for various instructional tasks. Model Link
  2. StableLM Zephyr: A smaller, more efficient model for quick and compact responses. Model Link

Usage

The script allows you to interact with pre-trained language models. To run the script, navigate to the cloned repository's directory and execute:

python3 slm.py

There is an additional script that shows how to call the Google search API from code to fetch knowledge and real time information.

python3 google.py

Useful Links

  • LM Studio: For a selection of local language models and a pretty user interface, visit lmstudio.ai.
  • Hugging Face: Explore a wide range of models published on huggingface.com.

Contributing

Feel free to fork this repository and contribute by submitting a pull request. We appreciate any input!

roanoke-slm-workshop's People

Contributors

tchlux avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.