You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
model, image_processor, tokenizer, device=Run_LLaVa.Turn_On_LLaVa() # Turn on the LLaVa model and get the model, image processor, tokenizer and the device
Copy file name to clipboardExpand all lines: advanced-zero-click-deployment-interface/FlowSteering/ApplicationCode/README.md
+9-33Lines changed: 9 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,6 @@
8
8
9
9
In this directory, you will find the code for the GenAI EcoSystem. The GenAI EcoSystem consists of a collection of scripts designed to simulate an email system with multiple users and dedicated servers.
10
10
11
-
12
-
13
-
14
11
The system consists of three main components: the Email Server, the LLaVa Server, and the End User Clients.
15
12
* The Email Server is responsible for sending and receiving emails from the End User Clients.
16
13
* The LLaVa Server is the GenAI service responsible for handling the emails that were sent to the End User Clients.
@@ -25,9 +22,6 @@ The system consists of three main components: the Email Server, the LLaVa Server
25
22
26
23
In our experiments, we utilized a single machine to run both the Email Server and the LLaVa Server. This machine was equipped with a single NVIDIA Quadro RTX 6000 24GB GPU. Additionally, we employed seven virtual machines to run the End User Clients.
27
24
28
-
29
-
30
-
31
25
## Running the GenAI EcoSystem
32
26
33
27
### 1. Run the Email Server
@@ -37,7 +31,7 @@ file to set the server configuration.
37
31
```python
38
32
SERVER_HOST='0.0.0.0'# Change this to the IP address of the machine where the Email Server will run
39
33
SERVER_PORT=1234# Change this to the port where the Email Server will listen
40
-
saveMail_directory ="FlowSteering/ApplicationCode/EmailServer/Database/EmailServerMailDatabase"# Change this to the directory where you want to save the emails inbox for each user
34
+
saveMail_directory ="FlowSteering/ApplicationCode/EmailServer/EmailServerMailDatabase"# Change this to the directory where you want to save the emails inbox for each user
#### To run the Email Server execute the following command in the EmailServer directory
66
57
```bash
67
58
python3 EmailServer.py
@@ -92,9 +83,6 @@ def handle_messages():
92
83
SendToLLaVa()
93
84
```
94
85
95
-
96
-
97
-
98
86
#### To run the LLaVa Server execute the following command in the LLaVaServer directory
99
87
```bash
100
88
python3 LLaVaServer.py
@@ -109,16 +97,12 @@ Since this script is designed to run on multiple machines, you don't need to edi
109
97
You can find an example of the CSV file named: [EndUserBaseEmails.csv](../../FlowSteering/ApplicationCode/EndUserCode/EndUserClientBaseEmails/EndUserBaseEmails.csv).
110
98
The function responsible for reading this CSV file is located in the [EndUserClient.py](../../FlowSteering/ApplicationCode/EndUserCode/EndUserClient.py) file under the respective function.
111
99
112
-
113
100
```python
114
101
defread_emails_from_file():
115
102
```
116
103
117
-
118
-
119
104
The script for each End User Client runs in a loop, sending a request to the Email Server to check the inbox for new emails every 10-20 seconds.
120
105
121
-
122
106
```python
123
107
defmain():
124
108
whileTrue:
@@ -129,9 +113,6 @@ def main():
129
113
If there is a new email in the inbox, the Email server will send the email to the End User Client, and a pop-up window will appear with the email content.
130
114
Next the End User Client will send the email to the LLaVa Server for classification, and the LLaVa Server will send the classification back to the End User Client.
@@ -140,9 +121,6 @@ Finally, the End User Client will act based on the classification returned by th
140
121
141
122
For our experiments, we implemented the action "Forward" and left the other actions as placeholders.
142
123
143
-
144
-
145
-
146
124
```python
147
125
if Classification =='reply':
148
126
print('Manual action is required for replying to this email, so it will be transferred to the Manual Folder.')
@@ -157,10 +135,8 @@ For our experiments, we implemented the action "Forward" and left the other acti
157
135
elif Classification =='spam':
158
136
print('Moving the email to the Spam Folder')
159
137
pass
160
-
161
138
```
162
139
163
-
164
140
#### To run the End User Client execute the following command in the EndUserCode directory and replace the configurations of the server and the user with your own configurations
@@ -172,9 +148,6 @@ Navigate to the [EndUserCode directory](../../FlowSteering/ApplicationCode/EndUs
172
148
173
149
This code is a simplified version of the End User Client, used solely to send the initial malicious email to the End User Clients, as they are not composing new emails.
174
150
175
-
176
-
177
-
178
151
Configure the following variables to send the email:
179
152
```python
180
153
defmain():
@@ -195,25 +168,28 @@ Next, the Attacker Client will send two identical emails to the Email Server, wi
195
168
SERVER_EMAIL_PORT)
196
169
```
197
170
198
-
199
-
200
-
201
171
#### To run the Attacker Client execute the following command in the EndUserCode directory and replace the configurations of the server and the user with your own configurations
In our experiments, we developed a basic GenAI email application consisting of several components. You are welcome to modify any part of the system and tailor it to your own requirements and preferences.
210
179
180
+
## Recent Changes and Additions
211
181
182
+
We have recently made several updates and additions to the codebase to enhance the functionality and performance of the GenAI EcoSystem. These changes include:
212
183
184
+
1.**Improved Network Handling**: Enhanced the network handling capabilities to address issues related to image transmission over sockets, especially when using virtual machines. A default image is now loaded when an image fails to send correctly due to network issues.
213
185
186
+
2.**Optimized Email Server**: Refined the Email Server's handling of incoming connections and email storage. The server now creates a directory to save the email inbox for each user, ensuring better organization and retrieval of emails.
214
187
188
+
3.**Enhanced LLaVa Server**: Updated the LLaVa Server to process incoming emails more efficiently using the LLaVa model. The server now listens for incoming connections, processes emails, and sends responses back to the End User Clients seamlessly.
215
189
190
+
4.**End User Client Improvements**: Improved the End User Client script to run in a loop, checking the inbox for new emails every 10-20 seconds. The script now handles email classification and actions based on the classification returned by the LLaVa Server.
216
191
192
+
5.**Attacker Client Simplification**: Simplified the Attacker Client script to send the initial malicious email to the End User Clients. The script now sends two identical emails to the Email Server, targeting specific recipients.
217
193
218
-
194
+
These updates aim to provide a more robust and efficient GenAI EcoSystem, ensuring smooth communication and interaction between the various components.
sudo systemctl reload nginx # restart Nginx service to load the new config
56
56
sudo systemctl status nginx # check the status of the Nginx service. It should be active (running).
57
57
```
58
+
59
+
## Recent Changes and Additions
60
+
61
+
We have recently made several updates and additions to the codebase to enhance the functionality and performance of the Nginx gateway. These changes include:
62
+
63
+
1.**Improved Security Features**: Enhanced the security features of the Nginx gateway to provide better protection for Gradio servers. This includes additional firewall rules and connection limits.
64
+
65
+
2.**Optimized Load Balancing**: Refined the load balancing capabilities of the Nginx gateway to ensure efficient distribution of traffic across multiple Gradio servers.
66
+
67
+
3.**Dynamic Server Management**: Updated the Nginx configuration to support dynamic mounting and unmounting of Gradio servers, allowing for more flexible server management.
68
+
69
+
4.**Simplified Deployment Process**: Streamlined the deployment process for the Nginx gateway, making it easier to set up and configure on various Linux distributions.
70
+
71
+
These updates aim to provide a more robust and efficient Nginx gateway, ensuring smooth communication and interaction between the various components of the system.
0 commit comments