Spaces:
Running
Running
Commit
·
ae1a8b3
1
Parent(s):
7d9c3d1
moved omnitool to a submodule
Browse files- .gitmodules +1 -1
- Dockerfile +2 -2
- README.md +3 -308
- myNodeServer.js → hf_server.js +0 -0
- omnitool +1 -0
- omnitool_init.sh +51 -30
- omnitool_start.sh +0 -40
- prepare.sh +0 -32
.gitmodules
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
[submodule "omnitool"]
|
2 |
path = omnitool
|
3 |
-
url = https://github.com/omnitool-ai/omnitool
|
|
|
1 |
[submodule "omnitool"]
|
2 |
path = omnitool
|
3 |
+
url = https://github.com/omnitool-ai/omnitool.git
|
Dockerfile
CHANGED
@@ -3,7 +3,7 @@ FROM node:20.6.1
|
|
3 |
USER node
|
4 |
WORKDIR /app
|
5 |
|
6 |
-
RUN chmod
|
7 |
#RUN mkdir -p /app/omnitool
|
8 |
#RUN chmod 777 /app/omnitool
|
9 |
#RUN mkdir -p /app/omnitool/node_modules
|
@@ -21,4 +21,4 @@ COPY --chown=node . /app
|
|
21 |
RUN yarn install
|
22 |
EXPOSE 4444
|
23 |
|
24 |
-
CMD ["node", "
|
|
|
3 |
USER node
|
4 |
WORKDIR /app
|
5 |
|
6 |
+
RUN chmod 0777 /app
|
7 |
#RUN mkdir -p /app/omnitool
|
8 |
#RUN chmod 777 /app/omnitool
|
9 |
#RUN mkdir -p /app/omnitool/node_modules
|
|
|
21 |
RUN yarn install
|
22 |
EXPOSE 4444
|
23 |
|
24 |
+
CMD ["node", "hf_server.js"]
|
README.md
CHANGED
@@ -1,314 +1,9 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
emoji: 🐳
|
4 |
-
colorFrom:
|
5 |
colorTo: gray
|
6 |
sdk: docker
|
7 |
app_port: 4444
|
8 |
---
|
9 |
-
|
10 |
-
|
11 |
-
*Discover, Learn, Evaluate and Build with thousands of Generative AI Models.*
|
12 |
-
|
13 |
-
Omnitool.ai is an open-source, downloadable "AI Lab in a box" built for learners, enthusiasts and anyone with interest in the current wave of AI innovation. It provides an extensible browser based desktop environment for streamlined, hands-on interacting with the latest AI models from OpenAI, replicate.com, Stable Diffusion, Google, or other leading providers through a single, unified interface.
|
14 |
-
|
15 |
-

|
16 |
-
|
17 |
-
Watch the [demo](https://tinyurl.com/omnitool-demo)! and see more [videos](https://www.youtube.com/@OmnitoolAI/videos) on our Youtube channel.
|
18 |
-
|
19 |
-
## Why Omnitool?
|
20 |
-
|
21 |
-
With thousands of preprints and countless "AI tools" released each week, it is incredibly challenging to stay on top of the rapidly evolving AI ecosystem, to separate hype and facts and to extract durable long term skills and learning. PapersWithCode and GitHub repositories attached to arXiv papers provide ability to hands-on validate and apply the latest discoveries, but the fragile nature of the Python ecosystem and often steep hardware requirments dramatically limits accessibility. Likewise implementing and testing cloud based models requires delving deep into API documentation and wrestling with connecting code.
|
22 |
-
|
23 |
-
We believe that is a serious problem. AI may represent the first large scale technological disruption unbounded by logistical challenges, scaling along existing wires, API infastructure and app delivery platforms. Meanwhile, market pressure to adopt AI is felt by many businesses and teams.
|
24 |
-
|
25 |
-
Without educated decision makers and technical experts, businesses and public organisations alike are at high risk of falling for hype and magical narratives and expensive misadventures.
|
26 |
-
|
27 |
-
Omnitool is our attempt to improve this situation: A **single, unified interface** capable of connecting with as many AI models as possible and to **reduce the "time to hands on AI" to an absolute minimum**.
|
28 |
-
|
29 |
-
Omnitool is **highly extensible and interoperable**. Most OpenAPI3 based services can be connected and turned into "blocks" without writing code. It's extension framework enables deeper integrations of anything from custom UIs (Like Stability Dream Studio) to Game Engines (like BabyonJS or Phaser) to [Image manipulation libraries](https://github.com/georgzoeller/omni-extension-sharp/blob/master/README.md).
|
30 |
-
|
31 |
-
|
32 |
-
## What Omnitool is NOT
|
33 |
-
|
34 |
-
- Omnitool is **not a multi-user cloud SaaS product**. It's a downloadable, locally installed product.
|
35 |
-
- Omnitool is **NOT a no-code solution** meant to replace coding or enable non engineers to code. It's focused on interacting with AI use cases, not writing general purpose software.
|
36 |
-
- Omnitool is **not production/enterprise software**. (Yet.) It's a lab optimizing for access to the latest technologies over stability and, as with any lab, things may blow up from time to time.
|
37 |
-
|
38 |
-
|
39 |
-
## Table of Contents
|
40 |
-
|
41 |
-
- [Key Features](#key-features)
|
42 |
-
- [Quickstart](#quickstart-guide)
|
43 |
-
- [Manual Install](#manual-install)
|
44 |
-
- [PocketBase DB Admin (ADVANCED)](#pocketbase-db-admin-advanced)
|
45 |
-
- [Next Steps](#next-steps)
|
46 |
-
- [Changelist](#changelist)
|
47 |
-
|
48 |
-
## Key Features
|
49 |
-
|
50 |
-
### Self-hosted and Open Source
|
51 |
-
|
52 |
-
* Omnitool is local self-hosted software that turns your machine into a powerful AI Lab.
|
53 |
-
|
54 |
-
* You install Omnitool and it runs on your Mac, Windows or Linux notebook, desktop or server, not cloud servers.
|
55 |
-
* Data stores it's data locally on your machine and is only transmitted to the third party provider APIs you choose to access. Updates are managed via github.
|
56 |
-
* A Docker Image is forthcoming.
|
57 |
-
* If you are interested in running Omnitool in the cloud, please get in touch with us at [email protected]
|
58 |
-
|
59 |
-
* Open Source and Open Standards
|
60 |
-
* Omnitool is licensed as open source software and heavily leverages open standards, such as OpenAPI, making it interoperable and extensible.
|
61 |
-
|
62 |
-
### Rapid Access to the world of generative AI without GPU, Managing Python installations and learning dozens of APIs and interfaces
|
63 |
-
|
64 |
-
* Minimal Time-to-AI: It allows you to try out models and services in minutes without having to study API docs, write boilerplate code, manage python venvs or figuring out new user interfaces. Because of it's integration of many leading AI platforms, the lag time between "paper with code" to hands on experimentation often is cut down to days.
|
65 |
-
|
66 |
-
* It presents the vast world of generative AI - image, video, audio, text, and classification APIS - through a single, unified user interface without oversimplifying or hiding the power of the APIs.
|
67 |
-
|
68 |
-
### Comprehensive AI Provider Support
|
69 |
-
* Seamlessly provides access to 1000s of AI model and utility APIs from an rapidly growing list leading AI providers and aggregators, exposing them all via interoperable blocks.
|
70 |
-
|
71 |
-
Currently supported (v. 0.5.3) :
|
72 |
-
* [Civitai.com](https://civitai.com) (Model metadata access)
|
73 |
-
* [Deepl.com](https://deepl.com) (Document translation)
|
74 |
-
* [ElevenLabs.io](https://elevenlabs.io) (Multilingual voice generation)
|
75 |
-
* Getimg.ai (Image generation and manipulation APIs)
|
76 |
-
* Github.com (Various)
|
77 |
-
* Google.com
|
78 |
-
* Gmail
|
79 |
-
* Vertex (AI)
|
80 |
-
* Google Translate
|
81 |
-
* Google TTS (Text to Speech)
|
82 |
-
* Google Vision (Computer Vision)
|
83 |
-
* [Huggingface.com](https://huggingface.com) (1000's of models, including free inference models)
|
84 |
-
* [OpenAI.com](https://openai.com) (Image/Text/Audio Generation including GPT3/4/Visual, Whisper, Dall-e 2, Dall-e 3, Moderation APIs and more)
|
85 |
-
* [OpenRouter.ai](https://OpenRouter.ai) (100s of LLM APIs)
|
86 |
-
* [Perplexity.ai](https://perplexity.ai) (Text Generation)
|
87 |
-
* [Stability.ai](https://stability.ai) (Image Generation and Manipulation APIs)
|
88 |
-
* [TextSynth.com](https://textsynth.com) (LLM, translation, and classification APIs)
|
89 |
-
* [Replicate.com](https://replicate.com/explore) (1000s of models across all modalities)
|
90 |
-
* [Uberduck.com](https://uberduck.com) (Voice Generation, Music centric offerings)
|
91 |
-
* [Unsplash.com](https://unsplash.com) (Stock imagery)
|
92 |
-
* with many more APIs in testing...
|
93 |
-
|
94 |
-
* Support for the following Open Source APIs is in the final stages of testing:
|
95 |
-
* Automatic1111/SDNext API
|
96 |
-
* Oobabooga Text Generation API
|
97 |
-
* Ollama API
|
98 |
-
|
99 |
-
* Omnitool is able to generate blocks from any openapi.json definitions via URL or directly supplied file. We support a number of custom x- annotations that can be added to openapi definitions to allow omnitool to guide the block generation. It also supports creating "patches" on top of existing APIs to create customized blocks. With integrated JSONATA support, it is possible to build powerful data processing blocks using pure data.
|
100 |
-
|
101 |
-
|
102 |
-
### Extensible Architecture
|
103 |
-
|
104 |
-
* Inspired by the common modding architecture found in video game toolsets, Omnitool is built, from the ground up, to be extensible via multiple mechanisms:
|
105 |
-
* Simple **Client and Server scripts** allowing addition of /commands that are hot-reloaded, so editing and building is a breeze.
|
106 |
-
* **Client Extensions** - any web-app/webpage can be turned into an extension and integrated directly on Omnitool's desktop via it's window system. Omnitool's client SDK exposes the full range of platform functionality to extensions, allowing you to write apps or tools using every API or recipe enabled in Omnitool.
|
107 |
-
* **Server Extensions** - Server extensions written in javascript that can add new blocks, API and core functionality.
|
108 |
-
|
109 |
-
* Some examples of currently available extensions:
|
110 |
-
* omni-core-replicate, a core extensions that allows import of any AI model on [replicate.com](https://replicate.com) into a ready to use block in Omnitool
|
111 |
-
* [omni-extension-sharp](https://github.com/omnitool-community/omni-extension-sharp), an extension adding an array of Image Manipulation blocks such as format conversion, masking, composition and more based on the powerful [sharp](https://github.com/lovell/sharp) image processing library.
|
112 |
-
* omni-extension-minipaint, a powerful [photo editing tool](https://github.com/viliusle/miniPaint) useful for quickly creating and editing images without switching out of the app.
|
113 |
-
* omni-extension-openpose, a [OpenPose based](https://github.com/CMU-Perceptual-Computing-Lab/openpose) pose estimation and generation toolkit useful for creating guidance images for controlnet/diffusion models.
|
114 |
-
* omni-extension-tldraw, a whiteboarding/sketching extension built on [TLDraw](https://github.com/tldraw/tldraw), useful for generating input for visual transformers and diffusion models
|
115 |
-
* omni-extension-wavacity, a [full wasm implementation](https://wavacity.com/) of Audacity, a state of the art audio recorder/editor useful for generating and editing audio content.
|
116 |
-
|
117 |
-
* Visit the Extension tab in app or see our [Omnitool Community Github](https://github.com/orgs/omnitool-community/repositories) for a list of currently available extensions
|
118 |
-
|
119 |
-
|
120 |
-
## Quickstart Guide
|
121 |
-
|
122 |
-
We are currently testing installers for Windows and macOS. Until those are publicly available, please follow the manual installation steps.
|
123 |
-
|
124 |
-
## Manual Install
|
125 |
-
|
126 |
-
This guide will help you download the Omnitool software, and then build and start the Omnitool server in a directory running from your local machine.
|
127 |
-
|
128 |
-
You can then access the Omnitool software from a web browser on your local machine.
|
129 |
-
|
130 |
-
1. **Prerequisites**
|
131 |
-
|
132 |
-
Ensure you have the latest versions of the following sofware installed:
|
133 |
-
|
134 |
-
* [Node.js](https://nodejs.org/en)
|
135 |
-
* [Yarn](https://yarnpkg.com)
|
136 |
-
* [Git](https://en.wikipedia.org/wiki/Git)
|
137 |
-
|
138 |
-
|
139 |
-
2. **Get the Source Code**
|
140 |
-
- Open a terminal
|
141 |
-
- Navigate to where you want Omnitool to be installed
|
142 |
-
- Use the following command:
|
143 |
-
```
|
144 |
-
git clone https://github.com/omnitool-ai/omnitool
|
145 |
-
```
|
146 |
-
|
147 |
-
This will create the `omnitool` folder.
|
148 |
-
|
149 |
-
- Now navigate inside Omnitool's folder. By default:
|
150 |
-
```
|
151 |
-
cd omnitool
|
152 |
-
```
|
153 |
-
|
154 |
-
3. **Install Source Dependencies**
|
155 |
-
|
156 |
-
Run the following command in the root of the repository to install the necessary dependencies:
|
157 |
-
```
|
158 |
-
yarn install
|
159 |
-
```
|
160 |
-
**Troubleshooting**
|
161 |
-
|
162 |
-
* **PYTHON 3.12** - some users are reporting a yarn install failure due to **a missing python module 'distutils'**. To resolve this, we recommend running our fix script to detect and autofix any potential issues and try again. Or you can manually pip install 'setuptools' from the terminal.
|
163 |
-
```
|
164 |
-
node setup\fix.js
|
165 |
-
```
|
166 |
-
|
167 |
-
4. **Build and Start the Server**
|
168 |
-
|
169 |
-
Now we will use `yarn` and `Node.js` to build the server software locally on your machine and then start it running.
|
170 |
-
|
171 |
-
Windows:
|
172 |
-
```
|
173 |
-
start.bat
|
174 |
-
```
|
175 |
-
|
176 |
-
MacOS/Linux:
|
177 |
-
```
|
178 |
-
./start.sh
|
179 |
-
```
|
180 |
-
|
181 |
-
When successful, you will see the following message:
|
182 |
-
|
183 |
-
```
|
184 |
-
◐ Booting Server
|
185 |
-
✔ Server has started and is ready to accept connections on http://127.0.0.1:1688.
|
186 |
-
✔ Ctrl-C to quit.
|
187 |
-
```
|
188 |
-
|
189 |
-
5. **Open Omnitool in a Web Browser**
|
190 |
-
|
191 |
-
Omnitool.ai can now be accessed from:
|
192 |
-
[127.0.0.1:1688](http://127.0.0.1:1688)
|
193 |
-
|
194 |
-
---
|
195 |
-
6. **Explore the Sample Recipes**
|
196 |
-
Use the "Load Recipe" button in the menu to explore different functionality of the platform.
|
197 |
-
|
198 |
-
---
|
199 |
-
7. **Explore the Code**
|
200 |
-
For a list of scripts we use internally, try running:
|
201 |
-
```
|
202 |
-
yarn run
|
203 |
-
```
|
204 |
-
|
205 |
-
## PocketBase DB Admin (ADVANCED)
|
206 |
-
Recipes and various cache data are stored in a [PocketBase](https://pocketbase.io) database.
|
207 |
-
|
208 |
-
If the database is currently running, you can access the default PocketBase admin interface by navigating to [127.0.0.1:8090/_](http://127.0.0.1:8090/_)
|
209 |
-
|
210 |
-
Alternatively, the admin interface can be accessed directly within omnitool. From the main menu, choose the `Database Admin` option and the same interface will open inside the omnitool browser window.
|
211 |
-
|
212 |
-
o log in to the database, use the credentials
|
213 |
-
* Email: **[email protected]**
|
214 |
-
* Password: **[email protected]**
|
215 |
-
|
216 |
-
Once logged in, you can directly modify records using the PocketBase admin interface. This is particularly useful for advanced configurations and troubleshooting.
|
217 |
-
|
218 |
-
### Reset Local PocketBase Storage (ADVANCED)
|
219 |
-
|
220 |
-
There may be occasions when you need to reset your local database, either to recover from an invalid state or to start with a fresh install.
|
221 |
-
|
222 |
-
For Linux:
|
223 |
-
```bash
|
224 |
-
rm -rf ./local.bin
|
225 |
-
yarn start
|
226 |
-
```
|
227 |
-
For Windows:
|
228 |
-
```cmd
|
229 |
-
rmdir /s /q .\local.bin
|
230 |
-
yarn start
|
231 |
-
```
|
232 |
-
|
233 |
-
- **Warning**:
|
234 |
-
- **ALL YOUR LOCAL RECIPES, GENERATED IMAGES, DOCUMENTS, AUDIO ETC, WILL BE PERMANENTLY ERASED**
|
235 |
-
|
236 |
-
## Generating a JWT Token
|
237 |
-
|
238 |
-
Our service allows you to generate a JWT by running a specific script designed for this purpose. The script's signature is as follows:
|
239 |
-
|
240 |
-
```
|
241 |
-
/generateJwtToken <action> <subject> <expires_in>
|
242 |
-
```
|
243 |
-
|
244 |
-
**Parameters**
|
245 |
-
|
246 |
-
- `<action>`: This is a string parameter identifying the intended action to be performed. In the context of running recipes, this should be set to exec.
|
247 |
-
- `<subject>`: This is a string parameter that specifies the subject of the JWT. This could be the recipe that you intend to execute.
|
248 |
-
- `<expires_in>`: This is an integer parameter that determines the token's validity period in milliseconds.
|
249 |
-
|
250 |
-
**Example**
|
251 |
-
|
252 |
-
To generate a JWT for executing a recipe with a validity of 30,000 milliseconds (or 30 seconds), you would run the following script:
|
253 |
-
|
254 |
-
```
|
255 |
-
/generateJwtToken exec Workflow 30000
|
256 |
-
```
|
257 |
-
|
258 |
-
**Output**
|
259 |
-
|
260 |
-
The script will output a JWT, which is a token string to be used in the authorization header for your API requests.
|
261 |
-
|
262 |
-
### Executing a recipe with JWT Authentication
|
263 |
-
|
264 |
-
Once you have your JWT, you can execute a recipe by making a POST request to the recipe execution API. This request must include the JWT in the Authorization header.
|
265 |
-
|
266 |
-
**Endpoint**
|
267 |
-
|
268 |
-
```
|
269 |
-
POST http://127.0.0.1:1688/api/v1/workflow/exec
|
270 |
-
```
|
271 |
-
|
272 |
-
**Header**
|
273 |
-
|
274 |
-
```
|
275 |
-
Authorization: Bearer <token>
|
276 |
-
```
|
277 |
-
|
278 |
-
`<token>` is the JWT acquired from the /generateJwtToken script.
|
279 |
-
|
280 |
-
**Curl Example**
|
281 |
-
|
282 |
-
To make the request using curl, you would use the following command, replacing <token> with your actual JWT:
|
283 |
-
|
284 |
-
```
|
285 |
-
curl -X POST http://127.0.0.1:1688/api/v1/workflow/exec -H "Authorization: Bearer <token>"
|
286 |
-
```
|
287 |
-
|
288 |
-
**Response**
|
289 |
-
|
290 |
-
Upon success, the API will initiate the specified recipe. You will receive a JSON response containing details about the recipe's execution status, including any outputs or errors.
|
291 |
-
|
292 |
-
**Security Considerations**
|
293 |
-
|
294 |
-
- Keep your JWT secure to prevent unauthorized access to your recipes.
|
295 |
-
- Always use a secure connection to interact with the APIs.
|
296 |
-
- Regularly rotate your tokens and use a short expiration time to minimize the impact of potential leaks.
|
297 |
-
|
298 |
-
**Troubleshooting**
|
299 |
-
|
300 |
-
* If you encounter authorization errors, ensure the JWT has not expired, is correctly set in the header, and was generated with the proper parameters.
|
301 |
-
|
302 |
-
## Next Steps
|
303 |
-
|
304 |
-
1. Join the Omnitool.ai Discord Community
|
305 |
-
|
306 |
-
Interact with fellow users, share your experiences, ask questions, and be a part of our active and growing community on [Discord](https://tinyurl.com/omnitool-discord).
|
307 |
-
|
308 |
-
2. Contribute to Omnitool.ai
|
309 |
-
|
310 |
-
As an open-source platform, we welcome contributions from users like you. Whether it's improving documentation, adding new features, or simply sharing your unique use cases, your input is invaluable to us. Simply send us a pull-request and we'll be in contact.
|
311 |
-
|
312 |
-
3. Feedback and Suggestions
|
313 |
-
|
314 |
-
Your feedback helps shape the future of Omnitool.ai. Send your feedback and suggestions to [[email protected]](mailto:[email protected]), or share them directly in our [Discord #feedback channel](https://tinyurl.com/omnitool-feedback).
|
|
|
1 |
---
|
2 |
+
title: OMNITOOL.ai on Hugging Face
|
3 |
emoji: 🐳
|
4 |
+
colorFrom: orange
|
5 |
colorTo: gray
|
6 |
sdk: docker
|
7 |
app_port: 4444
|
8 |
---
|
9 |
+
Please see ./omnitool/README.md
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
myNodeServer.js → hf_server.js
RENAMED
File without changes
|
omnitool
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
Subproject commit 8cc31bba952351a937b58b010635022f01ccff06
|
omnitool_init.sh
CHANGED
@@ -1,50 +1,71 @@
|
|
1 |
#!/bin/bash
|
2 |
-
echo "
|
3 |
|
4 |
-
echo "
|
5 |
-
git clone https://github.com/omnitool-ai/omnitool
|
6 |
-
chown -R node:node ./omnitool
|
7 |
|
8 |
-
|
9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
-
|
12 |
-
|
13 |
-
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
-
echo "
|
16 |
if [ -d "/data" ]; then
|
17 |
-
echo "$(ls -l /data)"
|
18 |
echo "$(ls -l /data/files)"
|
19 |
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
cp -r /data ./omnitool/packages/omni-server/data.local
|
34 |
-
chown -R node ./omnitool/packages/omni-server/data.local
|
35 |
|
36 |
else
|
37 |
-
echo "
|
38 |
fi
|
39 |
|
40 |
-
echo "--- CD OMNITOOL ---"
|
41 |
cd omnitool
|
|
|
42 |
|
43 |
-
echo "
|
44 |
yarn
|
45 |
|
46 |
-
|
|
|
47 |
chown -Rh node .
|
48 |
|
49 |
-
echo "
|
50 |
yarn start -u -rb -R blocks
|
|
|
1 |
#!/bin/bash
|
2 |
+
echo "[->] START "
|
3 |
|
4 |
+
echo "[->] UPDATE OMNITOOL "
|
|
|
|
|
5 |
|
6 |
+
if [ -d "./omnitool" ]; then
|
7 |
+
echo "[v] OMNITOOL already present "
|
8 |
+
cd ./omnitool
|
9 |
+
git pull
|
10 |
+
cd ..
|
11 |
+
chmod 0777 ./omnitool
|
12 |
+
chown -R node:node ./omnitool
|
13 |
+
else
|
14 |
+
echo "[ERROR] OMNITOOL IS MISSING"
|
15 |
+
git clone https://github.com/omnitool-ai/omnitool.git
|
16 |
+
chmod 0777 ./omnitool
|
17 |
+
chown -R node:node ./omnitool
|
18 |
+
fi
|
19 |
|
20 |
+
if [ -d "./omnitool/node_modules" ]; then
|
21 |
+
echo "[v] OMNITOOL NODE_MODULES already present "
|
22 |
+
else
|
23 |
+
mkdir -p ./omnitool/node_modules
|
24 |
+
chmod 0777 ./omnitool/node_modules
|
25 |
+
chown node ./omnitool/node_modules
|
26 |
+
echo "[+] Adding OMNITOOL NODE_MODULES"
|
27 |
+
fi
|
28 |
|
29 |
+
echo "[->] CHECKING EXISTING /DATA "
|
30 |
if [ -d "/data" ]; then
|
|
|
31 |
echo "$(ls -l /data/files)"
|
32 |
|
33 |
+
if [ -L "./omnitool/packages/omni-server/data.local" ]; then
|
34 |
+
echo "[v] DATA.LOCAL symlink already present "
|
35 |
+
else
|
36 |
+
if [ -d "./omnitool/packages/omni-server/data.local" ]; then
|
37 |
+
echo "[v] DATA.LOCAL already present "
|
38 |
+
# hopefully it got copied over through the symlink in the previous run
|
39 |
+
rm -rf ./omnitool/packages/omni-server/data.local
|
40 |
+
|
41 |
+
mkdir ./omnitool/packages/omni-server/data.local
|
42 |
+
chmod 0777 ./omnitool/packages/omni-server/data.local
|
43 |
+
chown node ./omnitool/packages/omni-server/data.local
|
44 |
+
else
|
45 |
+
echo "[v] Creating DATA.LOCAL "
|
46 |
+
mkdir ./omnitool/packages/omni-server/data.local
|
47 |
+
chmod 0777 ./omnitool/packages/omni-server/data.local
|
48 |
+
chown node ./omnitool/packages/omni-server/data.local
|
49 |
+
fi
|
50 |
|
51 |
+
echo "[v] Creating the symlink "
|
52 |
+
ln -s /data ./omnitool/packages/omni-server/data.local
|
53 |
+
chown node ./omnitool/packages/omni-server/data.local
|
54 |
+
fi
|
|
|
|
|
55 |
|
56 |
else
|
57 |
+
echo "[v] NO persistent /DATA DETECTED. You can add 20Gig of persistent storage as a paid option to Hugging Face"
|
58 |
fi
|
59 |
|
|
|
60 |
cd omnitool
|
61 |
+
echo "[x] CD OMNITOOL "
|
62 |
|
63 |
+
echo "[->] YARN INSTALL "
|
64 |
yarn
|
65 |
|
66 |
+
# maybe that's all that is really needed (to be tested)
|
67 |
+
chmod -R 0777 .
|
68 |
chown -Rh node .
|
69 |
|
70 |
+
echo "[v] YARN START "
|
71 |
yarn start -u -rb -R blocks
|
omnitool_start.sh
DELETED
@@ -1,40 +0,0 @@
|
|
1 |
-
#!/bin/bash
|
2 |
-
echo "--- START ---"
|
3 |
-
|
4 |
-
echo "--- GIT OMNITOOL ---"
|
5 |
-
#git clone https://github.com/omnitool-ai/omnitool
|
6 |
-
mkdir -p ./omnitool/node_modules
|
7 |
-
chmod 777 ./omnitool/node_modules
|
8 |
-
|
9 |
-
echo "--- CHECKING EXISTING /DATA ---"
|
10 |
-
if [ -d "/data" ]; then
|
11 |
-
echo "$(ls -l /data)"
|
12 |
-
echo "$(ls -l /data/files)"
|
13 |
-
|
14 |
-
echo "--- CREATING the SYMLINK to /DATA ---"
|
15 |
-
if [ -d "./omnitool/packages/omni-server/data.local" ]; then
|
16 |
-
rm -rf ./omnitool/packages/omni-server/data.local
|
17 |
-
fi
|
18 |
-
mkdir ./omnitool/packages/omni-server/data.local
|
19 |
-
chown -Rh node ./omnitool/packages/omni-server/data.local
|
20 |
-
|
21 |
-
# Create the symlink
|
22 |
-
echo "--- Create the symlink ---"
|
23 |
-
ln -s /data ./omnitool/packages/omni-server/data.local
|
24 |
-
chown -Rh node ./omnitool/packages/omni-server/data.local
|
25 |
-
#chown -Rh node /data
|
26 |
-
else
|
27 |
-
echo "--- NO persistent /DATA DETECTED. You can add 20Gig of persistent storage as a paid option to Hugging Face"
|
28 |
-
fi
|
29 |
-
|
30 |
-
echo "--- CD OMNITOOL ---"
|
31 |
-
cd omnitool
|
32 |
-
|
33 |
-
echo "--- YARN INSTALL ---"
|
34 |
-
yarn
|
35 |
-
|
36 |
-
chown -Rh node .
|
37 |
-
chmod -R 777 .
|
38 |
-
|
39 |
-
echo "--- YARN START ---"
|
40 |
-
yarn start -u -rb -R blocks
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
prepare.sh
DELETED
@@ -1,32 +0,0 @@
|
|
1 |
-
echo " PREPARING for HUGGING FACE "
|
2 |
-
|
3 |
-
if [ -d "./omnitool/" ]; then
|
4 |
-
echo "[_] OMNITOOL ALREADY EXISTS "
|
5 |
-
else
|
6 |
-
echo "[x] CLONING FOR OMNITOOL GIT "
|
7 |
-
git clone https://github.com/omnitool-ai/omnitool
|
8 |
-
fi
|
9 |
-
|
10 |
-
if [ -d "./omnitool/.git" ]; then
|
11 |
-
echo "[x] REMOVING GIT files "
|
12 |
-
rm -rf ./omnitool/.git/
|
13 |
-
rm ./omnitool/.gitignore
|
14 |
-
rm ./omnitool/.gitattributes
|
15 |
-
else
|
16 |
-
echo "[_] NO GIT FILES DETECTED "
|
17 |
-
fi
|
18 |
-
|
19 |
-
if [ -f "./omnitool/packages/omni-server/config.default/models/nsfwjs/mobilenet-v2-quant/group1-shard1of1" ]; then
|
20 |
-
echo "[x] REMOVING large file from OMNITOOL distribution "
|
21 |
-
rm ./omnitool/packages/omni-server/config.default/models/nsfwjs/mobilenet-v2-quant/group1-shard1of1
|
22 |
-
else
|
23 |
-
echo "[_] NO LARGE FILE DETECTED "
|
24 |
-
fi
|
25 |
-
|
26 |
-
if [ "$(ls -A ./omnitool/assets)" ]; then
|
27 |
-
echo "[x] REMOVING ASSETS "
|
28 |
-
rm -rf ./omnitool/assets/
|
29 |
-
mkdir -p ./omnitool/assets
|
30 |
-
else
|
31 |
-
echo "[_] NO ASSETS DETECTED "
|
32 |
-
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|