ai: Allow Deep Search via API.
Browse files- API.md +22 -51
- README.md +1 -1
- ai +42 -0
- jarvis.py +0 -0
- requirements.txt +0 -0
API.md
CHANGED
@@ -1,78 +1,44 @@
|
|
1 |
#### INSTALLATIONS
|
2 |
```bash
|
3 |
# Linux/Android (Termux)/MacOS/Windows.
|
4 |
-
# Make sure you have "python3" and "pip" installed.
|
5 |
# This package have very small size.
|
6 |
-
pip install gradio_client rich --upgrade
|
7 |
|
8 |
-
|
9 |
-
pip install gradio_client rich --upgrade --ignore-installed --break-system-packages
|
10 |
```
|
11 |
|
12 |
-
####
|
13 |
```bash
|
14 |
-
#
|
15 |
-
|
16 |
-
nano jarvis # or whatever you want.
|
17 |
-
```
|
18 |
-
|
19 |
-
### JARVIS MAIN SCRIPT
|
20 |
-
```python
|
21 |
-
#!/usr/bin/env python3
|
22 |
-
import sys
|
23 |
-
from gradio_client import Client
|
24 |
-
from rich.console import Console
|
25 |
-
from rich.markdown import Markdown
|
26 |
-
console = Console()
|
27 |
-
jarvis = Client("hadadrjt/ai")
|
28 |
-
input = " ".join(sys.argv[1:]) if len(sys.argv) > 1 else "Hi!"
|
29 |
-
result = jarvis.predict(multi={"text": input}, api_name="/api")
|
30 |
-
responses = result[0][0][1]
|
31 |
-
markdown = Markdown(responses)
|
32 |
-
console.print(markdown)
|
33 |
-
```
|
34 |
|
35 |
-
|
36 |
-
|
37 |
-
#!/usr/bin/env python3
|
38 |
-
import sys
|
39 |
-
from gradio_client import Client
|
40 |
-
from rich.console import Console
|
41 |
-
from rich.markdown import Markdown
|
42 |
-
console = Console()
|
43 |
-
jarvis = Client("hadadrjt/ai")
|
44 |
-
model = "JARVIS: 2.1.2" # default to JARVIS, you can change the model here.
|
45 |
-
jarvis.predict(new=model, api_name="/change_model")
|
46 |
-
input_text = " ".join(sys.argv[1:]) if len(sys.argv) > 1 else "Hi!"
|
47 |
-
result = jarvis.predict(multi={"text": input_text}, api_name="/api")
|
48 |
-
response_text = result[0][0][1]
|
49 |
-
console.print(Markdown(response_text))
|
50 |
```
|
51 |
|
52 |
-
###
|
53 |
```bash
|
54 |
-
#
|
55 |
-
|
56 |
-
chmod a+x jarvis
|
57 |
-
```
|
58 |
|
59 |
-
|
60 |
-
|
61 |
-
./jarvis "Your message here."
|
62 |
-
# According the name file you create.
|
63 |
```
|
64 |
|
65 |
#### LINUX USER's
|
66 |
```bash
|
67 |
# Bonus for more flexible.
|
68 |
-
sudo mv
|
69 |
|
70 |
# Now you can run with simple command.
|
71 |
ai "Your message here."
|
72 |
```
|
73 |
|
74 |
-
###
|
75 |
```
|
|
|
|
|
|
|
76 |
Choose one of the model name for the JARVIS multi platform.
|
77 |
|
78 |
1. JARVIS: 2.1.2
|
@@ -93,4 +59,9 @@ Choose one of the model name for the JARVIS multi platform.
|
|
93 |
16. Qwen: Qwen2.5 VL 32B Instruct
|
94 |
17. Qwen: Qwen2.5 VL 72B Instruct
|
95 |
18. Agentica: Deepcoder 14B Preview
|
|
|
|
|
|
|
|
|
|
|
96 |
```
|
|
|
1 |
#### INSTALLATIONS
|
2 |
```bash
|
3 |
# Linux/Android (Termux)/MacOS/Windows.
|
4 |
+
# Make sure you have "wget", "python3" and "pip" installed.
|
5 |
# This package have very small size.
|
|
|
6 |
|
7 |
+
pip install gradio_client rich --upgrade
|
|
|
8 |
```
|
9 |
|
10 |
+
#### DOWNLOAD JARVIS SCRIPT
|
11 |
```bash
|
12 |
+
# Terminal script.
|
13 |
+
wget https://huggingface.co/spaces/hadadrjt/ai/raw/main/ai
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
+
# Set permission.
|
16 |
+
chmod a+x ai
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
```
|
18 |
|
19 |
+
### RUN JARVIS IN YOUR TERMINAL
|
20 |
```bash
|
21 |
+
# Example normal usage.
|
22 |
+
./ai "Your message here."
|
|
|
|
|
23 |
|
24 |
+
# Example with Deep Search.
|
25 |
+
./ai -d "Your message here."
|
|
|
|
|
26 |
```
|
27 |
|
28 |
#### LINUX USER's
|
29 |
```bash
|
30 |
# Bonus for more flexible.
|
31 |
+
sudo mv ai /bin/
|
32 |
|
33 |
# Now you can run with simple command.
|
34 |
ai "Your message here."
|
35 |
```
|
36 |
|
37 |
+
### MULTI PLATFORM
|
38 |
```
|
39 |
+
Edit JARVIS terminal script, and find this code:
|
40 |
+
model = "JARVIS: 2.1.2"
|
41 |
+
|
42 |
Choose one of the model name for the JARVIS multi platform.
|
43 |
|
44 |
1. JARVIS: 2.1.2
|
|
|
59 |
16. Qwen: Qwen2.5 VL 32B Instruct
|
60 |
17. Qwen: Qwen2.5 VL 72B Instruct
|
61 |
18. Agentica: Deepcoder 14B Preview
|
62 |
+
|
63 |
+
Example:
|
64 |
+
model = "DeepSeek: V3-0324"
|
65 |
+
|
66 |
+
Please note that the Deep Search feature is only available for JARVIS: 2.1.2.
|
67 |
```
|
README.md
CHANGED
@@ -3,7 +3,7 @@ title: JARVIS AI
|
|
3 |
colorFrom: yellow
|
4 |
colorTo: purple
|
5 |
sdk: gradio
|
6 |
-
sdk_version: 5.
|
7 |
app_file: jarvis.py
|
8 |
pinned: true
|
9 |
short_description: Inspired by Iron Man movies.
|
|
|
3 |
colorFrom: yellow
|
4 |
colorTo: purple
|
5 |
sdk: gradio
|
6 |
+
sdk_version: 5.27.0
|
7 |
app_file: jarvis.py
|
8 |
pinned: true
|
9 |
short_description: Inspired by Iron Man movies.
|
ai
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/usr/bin/env python3
|
2 |
+
#
|
3 |
+
# SPDX-FileCopyrightText: Hadad <[email protected]>
|
4 |
+
# SPDX-License-Identifier: Apache-2.0
|
5 |
+
#
|
6 |
+
import sys
|
7 |
+
|
8 |
+
from gradio_client import Client
|
9 |
+
from rich.console import Console
|
10 |
+
from rich.markdown import Markdown
|
11 |
+
from rich.panel import Panel
|
12 |
+
|
13 |
+
console = Console()
|
14 |
+
jarvis = Client("hadadrjt/ai")
|
15 |
+
|
16 |
+
model = "JARVIS: 2.1.2" # You can change the models here.
|
17 |
+
|
18 |
+
args = sys.argv[1:]
|
19 |
+
deep_search = False
|
20 |
+
if "-d" in args:
|
21 |
+
deep_search = True
|
22 |
+
args.remove("-d")
|
23 |
+
input_text = " ".join(args) if args else "Hi!"
|
24 |
+
jarvis.predict(new=model, api_name="/change_model")
|
25 |
+
if deep_search and model != "JARVIS: 2.1.2": # DO NOT CHANGE THIS!
|
26 |
+
console.print("")
|
27 |
+
console.print("------------------------------------------------------")
|
28 |
+
console.print("[bold red]Deep Search is only available for model JARVIS: 2.1.2.[/bold red]")
|
29 |
+
console.print("------------------------------------------------------")
|
30 |
+
console.print("")
|
31 |
+
deep_search = False
|
32 |
+
if deep_search:
|
33 |
+
result = jarvis.predict(
|
34 |
+
multi={"text": input_text},
|
35 |
+
deep_search=True,
|
36 |
+
api_name="/respond_async")
|
37 |
+
else:
|
38 |
+
result = jarvis.predict(
|
39 |
+
multi={"text": input_text},
|
40 |
+
api_name="/api")
|
41 |
+
response_text = result[0][0][1]
|
42 |
+
console.print(Markdown(response_text))
|
jarvis.py
CHANGED
File without changes
|
requirements.txt
CHANGED
File without changes
|