Giter VIP home page Giter VIP logo

verify-llm's Introduction

Verify LLM

Prerequestite

Install the required model in Ollama

ollama pull codellama

Implementation

Initial Generation

required file:

prompt path
│   problem.txt         - the problem used to prompt the LLM

Steps:

  1. Run the Python script with the init mode. The argument --prompt_path should be the directory of your problem.txt

    python main.py --prompt_path codebase/example --mode init

After this command the script will create a completion.txt file in the prompt_path directory which includes the completion of the LLM

  1. Extract the code from the completion.txt and save it into Solution.java file in the prompt_path directory to allow Infer to analyze.

  2. Run the command to let infer to analyze the Solution.java

    infer run -- javac codebase/example/Solution.java
  3. If the Infer provides the errors , then organize the errors and put them into a file called infer_output.txt int the prompt_path directory.

Iterative Clean up

required file:

prompt path
│   problem.txt         - the problem used to prompt the LLM
│		infer_output.txt    - the errors detected by infer
│		Solution.java       - the java completion from the previous iteration

Steps:

  1. Run the Python script with the iter mode. The argument --prompt_path should be the directory of your problem.txt

    python main.py --prompt_path codebase/example --mode iter

After this command the script will create a completion.txt file in the prompt_path directory which includes the completion of the LLM

  1. Extract the code from the completion.txt and save it into Solution.java file in the prompt_path directory to allow Infer to analyze.

  2. Run the command to let infer to analyze the Solution.java

    infer run -- javac codebase/example/Solution.java
  3. If the Infer provides the errors , then organize the errors and put them into a file called infer_output.txt int the prompt_path directory.

verify-llm's People

Contributors

binxuan39 avatar

Watchers

 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.