Git Product home page Git Product logo

palm-ai-text's Introduction

PaLM API Text demo

This demo is a Python Flask web app that uses the Google PaLM API for generative AI.

To Run

  1. Clone the repo
  2. Change to the app folder and run the following to create a Virtual Environment:
pip install virtualenv
virtualenv ~/palm-env
source ~/palm-env/bin/activate
  1. Use Pip to install the prequisites
pip install -r requirements.txt
  1. To test the pogram run:
python main.py

You can customize the program using the config.yaml file.

Here is an example. Changing the context will change the bahavior of the model. You can make the model pretend to be anything you want (a bartender, mechanic, whatever). The example below makes the model emulate a Barista.

Change the YAML file and restart the program

app:
 title: "CoffeeBot"
 subtitle: "Your friendly online BaristAI"

palm:
  botname: "CoffeeBot"
  context: "Your name is CoffeeBot. You are a barista and expert on all things related to coffee and tea."
  temperature: 0.8
  max_output_tokens: 1024
  top_p: 0.8
  top_k: 40

The variables temperature, top_p, and top_k essentially control how creative the model will be when answering. Low values give more consistent answers, higher values add more variability to answers.

temperature is in the range 0.0 to 1.0 top_p is in the range 0.0 to 1.0 top_k is in the range 1 to 40

max_output_tokens does just what the name implies. It is in the range 1 to 1024.

palm-ai-text's People

Contributors

drehnstrom 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.