MCPcopy Index your code
hub / github.com/SeungyounShin/Llama2-Code-Interpreter

github.com/SeungyounShin/Llama2-Code-Interpreter @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
111 symbols 633 edges 22 files 9 documented · 8%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

llama2 code interprerter icon

Llama2 Code Interpreter

🤗 CodeLlama 7B Finetuned Model (HF)

Python 3.9+ Code style: black

This project allows LLM to generate code, execute it, receive feedback, debug, and answer questions based on the whole process. It is designed to be intuitive and versatile, capable of dealing with multiple languages and frameworks.

The purpose and direction of the project

Quick Start

Run the Gradio App: bash python3 chatbot.py --path Seungyoun/codellama-7b-instruct-pad

News

HumanEval

Model Score(pass@1)
Codellama instruct 7b 34.8%
Codellama instruct 7b - finetuning 70.12%

GSM8K

Model Score
Code Llama 7B 13%
Code Llama 13B 20.8%
Codellama instruct 7b - finetuning 28%

🌟 Key Features

  • [x] 🚀 Code Generation and Execution: Llama2 is capable of generating code, which it then automatically identifies and executes within its generated code blocks.
  • [x] Monitors and retains Python variables that were used in previously executed code blocks.
  • [x] 🌟 At the moment, my focus is on "Data development for GPT-4 code interpretation" and "Enhancing the model using this data". For more details, check out the feat/finetuning branch in our repository.
  • [x] 🌟 CodeLlama Support CodeLlama2

Examples


Llama2 in Action

example1_president_search_with_code

In the GIF, Llama2 is seen in action. A user types in the request: Plot Nvidia 90 days chart. Llama2, an advanced code interpreter fine-tuned on a select dataset, swiftly queries Yahoo Finance. Moments later, it fetches the latest Nvidia stock prices from the past 90 days. Using Matplotlib, Llama2 then generates a clear and detailed stock price chart for Nvidia, showcasing its performance over the given period.

Installation

  1. Clone the Repository (if you haven't already): bash git clone https://github.com/SeungyounShin/Llama2-Code-Interpreter.git cd Llama2-Code-Interpreter

  2. Install the required dependencies: bash pip install -r requirements.txt


Run App with GPT4 finetunned Llama Model

To start interacting with Llama2 via the Gradio UI using codellama-7b-instruct-pad, follow the steps below:

  1. Run the Gradio App: bash python3 chatbot.py --path Seungyoun/codellama-7b-instruct-pad

For those who want to use other models:

General Instructions to Run App

To start interacting with Llama2 via the Gradio UI using other models:

  1. Run the Command: bash python3 chatbot.py --model_path <your-model-path>

Replace <your-model-path> with the path to the model file you wish to use. A recommended model for chat interactions is meta-llama/Llama-2-13b-chat.

Contributions

Contributions, issues, and feature requests are welcome! Feel free to check issues page.

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Seungyoun, Shin - 2022021568@korea.ac.kr

Acknowledgement

Here are some relevant and related projects that have contributed to the development of this work:

  1. llama2 : GitHub Repository
  2. yet-another-gpt-tutorial : GitHub Repository

These projects have been instrumental in providing valuable insights and resources, and their contributions are highly appreciated.


Core symbols most depended-on inside this repo

add_and_run
called by 5
code_interpreter/JuypyterClient.py
extract_code_blocks
called by 5
code_interpreter/BaseCodeInterpreter.py
execute_code_and_return_output
called by 5
code_interpreter/BaseCodeInterpreter.py
permute
called by 4
utils/convert_llama_weights_to_hf.py
get_embedding
called by 4
code_interpreter/RetrospectiveGPTCodeInterpreter.py
generate
called by 3
chatbot.py
change_markdown_image
called by 3
chatbot.py
msg_to_code_result_tok_temp
called by 3
finetuning/conversation_template.py

Shape

Function 50
Method 44
Class 17

Languages

Python100%

Modules by API surface

code_interpreter/RetrospectiveGPTCodeInterpreter.py19 symbols
finetuning/train.py17 symbols
eval/human_eval.py11 symbols
code_interpreter/GPTCodeInterpreterDataCollect.py9 symbols
code_interpreter/GPTCodeInterpreter.py9 symbols
utils/convert_llama_weights_to_hf.py7 symbols
code_interpreter/LlamaCodeInterpreter.py7 symbols
code_interpreter/JuypyterClient.py6 symbols
chatbot.py6 symbols
code_interpreter/BaseCodeInterpreter.py5 symbols
eval/inference.py4 symbols
utils/cleaner.py2 symbols

For agents

$ claude mcp add Llama2-Code-Interpreter \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page