xqx666 commited on
Commit
f108035
·
1 Parent(s): c66d288

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +1 -110
README.md CHANGED
@@ -8,113 +8,4 @@ sdk_version: 3.41.2
8
  app_file: app.py
9
  pinned: false
10
  license: mit
11
- duplicated_from: dongsiqie/Code-Interpreter
12
- ---
13
-
14
- # Local-Code-Interpreter
15
- A local implementation of OpenAI's ChatGPT Code Interpreter.
16
-
17
- ## Introduction
18
-
19
- OpenAI's Code Interpreter plugin for ChatGPT is a revolutionary feature that allows the execution of Python code within the AI model. However, it execute code within an online sandbox and has certain limitations. In this project, we present Local Code Interpreter – which enables code execution on your local device, offering enhanced flexibility, security, and convenience.
20
-
21
- ## Key Advantages
22
-
23
- - **Custom Environment**: Execute code in a customized environment of your choice, ensuring you have the right packages and settings.
24
-
25
- - **Seamless Experience**: Say goodbye to file size restrictions and internet issues while uploading. With Local Code Interpreter, you're in full control.
26
-
27
- - **GPT-3.5 Availability**: While official Code Interpreter is only available for GPT-4 model, the Local Code Interpreter offers the flexibility to switch between both GPT-3.5 and GPT-4 models.
28
-
29
- - **Enhanced Data Security**: Keep your data more secure by running code locally, minimizing data transfer over the internet.
30
-
31
- ## Note
32
- Executing AI-generated code without human review on your own device is not safe. You are responsible for taking measures to protect the security of your device and data (such as using a virtural machine) before launching this program. All consequences caused by using this program shall be borne by youself.
33
-
34
- ## Usage
35
-
36
- ### Getting Started
37
-
38
- 1. Clone this repository to your local device
39
- ```shell
40
- git clone https://github.com/MrGreyfun/Local-Code-Interpreter.git
41
- ```
42
-
43
- 2. Install the necessary dependencies. The program has been tested on Windows 10 and CentOS Linux 7.8, with Python 3.9.16. Required packages include:
44
- ```text
45
- Jupyter Notebook 6.5.4
46
- gradio 3.39.0
47
- openai 0.27.8
48
- ```
49
- Other system or package version may also work.
50
- ### Configuration
51
-
52
- 1. Create a `config.json` file in the `src` directory, following the examples provided in the `config_example` directory.
53
-
54
- 2. Configure your API key in the `config.json` file.
55
-
56
- Please Note:
57
- 1. **Set the `model_name` Correctly**
58
- This program relies on the function calling capability of two specific models:
59
- - `gpt-3.5-turbo-0613`
60
- - `gpt-4-0613`
61
-
62
- Older versions of the models will not work.
63
-
64
- For Azure OpenAI service users:
65
- - Set the `model_name` as your deployment name.
66
- - Confirm that the deployed model corresponds to the `0613` version.
67
-
68
- 2. **API Version Settings**
69
- If you're using Azure OpenAI service, set the `API_VERSION` to `2023-07-01-preview` in the `config.json` file. Note that other API versions do not support the necessary function calls for this program.
70
-
71
- 3. **Alternate API Key Handling**
72
- If you prefer not to store your API key in the `config.json` file, you can opt for an alternate approach:
73
- - Leave the `API_KEY` field in `config.json` as an empty string:
74
- ```json
75
- "API_KEY": ""
76
- ```
77
- - Set the environment variable `OPENAI_API_KEY` with your API key before running the program:
78
- - On Windows:
79
- ```shell
80
- set OPENAI_API_KEY=<YOUR-API-KEY>
81
- ```
82
- - On Linux:
83
- ```shell
84
- export OPENAI_API_KEY=<YOUR-API-KEY>
85
- ```
86
-
87
- ## Getting Started
88
-
89
- 1. Navigate to the `src` directory.
90
-
91
- 2. Run the command:
92
- ```shell
93
- python web_ui.py
94
- ```
95
-
96
- 3. Access the generated link in your browser to start using the Local Code Interpreter.
97
-
98
- ## Example
99
-
100
- Imagine uploading a data file and requesting the model to perform linear regression and visualize the data. See how Local Code Interpreter provides a seamless experience:
101
-
102
- 1. Upload the data and request linear regression:
103
- ![Example 1](example_img/1.jpg)
104
-
105
- 2. Encounter an error in the generated code:
106
- ![Example 2](example_img/2.jpg)
107
-
108
- 3. ChatGPT automatically checks the data structure and fixes the bug:
109
- ![Example 3](example_img/3.jpg)
110
-
111
- 4. The corrected code runs successfully:
112
- ![Example 4](example_img/4.jpg)
113
-
114
- 5. The final result meets your requirements:
115
- ![Example 5](example_img/5.jpg)
116
- ![Example 6](example_img/6.jpg)
117
-
118
-
119
-
120
-
 
8
  app_file: app.py
9
  pinned: false
10
  license: mit
11
+ ---