jetson-examples 0.0.4__py3-none-any.whl → 0.0.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: jetson-examples
3
- Version: 0.0.4
3
+ Version: 0.0.6
4
4
  Summary: Running Gen AI models and applications on NVIDIA Jetson devices with one-line command
5
5
  Author-email: luozhixin <zhixin.luo@seeed.cc>
6
6
  Project-URL: Homepage, https://github.com/Seeed-Projects/jetson-examples
@@ -61,6 +61,8 @@ Here are some examples that can be run:
61
61
 
62
62
  More Examples can be found [examples.md](./docs/examples.md)
63
63
 
64
+ Want to add a Example by yourself? Check this [develop.md](./docs/develop.md)
65
+
64
66
  ## TODO List
65
67
 
66
68
  - [ ] check disk space enough or not before run
@@ -0,0 +1,26 @@
1
+ reComputer/__init__.py,sha256=QiiYsv0kcJaB8wCWyT-FnI2b6be87HA-CrrIUn8LQhg,22
2
+ reComputer/main.py,sha256=IOrKYEatTeAfvM1yRNNrZDAfM9LsER334FgOuRVah44,1821
3
+ reComputer/scripts/check.sh,sha256=cUMwAjHpgJoaD5a8gTLJG7QWjF9CyKPgQ-ewRNK3FD8,127
4
+ reComputer/scripts/run.sh,sha256=zlVqaCu12VPkecxy5FR0XDxbOeogeGBKuPU0Ow2qJyw,2066
5
+ reComputer/scripts/update.sh,sha256=9Pw9-laO8NU2-4t4UisjFEwHPY5-ZAIoDi3AqWBzBbs,900
6
+ reComputer/scripts/Sheared-LLaMA-2.7B-ShareGPT/run.sh,sha256=ktndtYTKXLJd6pHi5WN93NBLxreUsCe9Rim3U7-cyJs,134
7
+ reComputer/scripts/hello-world/readme.md,sha256=LbPVSal_UuOsJe1v4otMfci6UN0gUqecQlynQaHiHME,87
8
+ reComputer/scripts/hello-world/run.sh,sha256=ZjFioxwmBTtvZoBHJNpHc6AS97HksyXnOnKy3LZTShs,280
9
+ reComputer/scripts/live-llava/run.sh,sha256=4sWld5d8Fkr9GUVqLH2S1RyOKOjobhjojSzuJu8EuCg,10137
10
+ reComputer/scripts/llama3/run.sh,sha256=i2MAtkWdYq-XaHUHZ13uO-8QeshCEBq32DOi1wCBSeo,226
11
+ reComputer/scripts/llava/run.sh,sha256=xukwaZz7YKQFc-_LtuBUL6zcywciS0_IQ8OeTAKGe3o,148
12
+ reComputer/scripts/llava-v1.5-7b/run.sh,sha256=Gsd3vo91bDV8LSuQPnYX82jsWXcbT2maTASA0u4ufBQ,147
13
+ reComputer/scripts/llava-v1.6-vicuna-7b/run.sh,sha256=89VjiRvleYluLiSXfDOJBPXnkG8g0wDb3y5bFD_Nus0,165
14
+ reComputer/scripts/nanodb/readme.md,sha256=kzWnCq4qAB95Sssj8mFs_VrH5ju3phSqygLjSRO3ceQ,247
15
+ reComputer/scripts/nanodb/run.sh,sha256=6MKQgYqDhg-Rvh3Sk4sNm5V2jg1ZgtSVvB2fOjH_KuE,1875
16
+ reComputer/scripts/nanoowl/run.sh,sha256=at89nn0-95XonUvLf8u6f_rAwTuw2iS7MhnlApdzEQg,161
17
+ reComputer/scripts/ollama/run.sh,sha256=AUEYvW4l8msN-XOouET-l_lYu07CR8ssMNf6u0u2n6I,143
18
+ reComputer/scripts/stable-diffusion-webui/run.sh,sha256=ralIICACH1AiK2A8JEekUS6Cof4ZGjaRNmPYgPPJybc,57
19
+ reComputer/scripts/text-generation-webui/run.sh,sha256=WZ2wwuSuXkd6KVQ0lx9KUvNKHx_dN-UBzraV2papdqM,304
20
+ reComputer/scripts/whisper/run.sh,sha256=u5JPV0XhTM2Q02GOOPkoLUS-jNRE1DWxyW7FhV5qmb4,43
21
+ jetson_examples-0.0.6.dist-info/LICENSE,sha256=ac_LOi8ChcJhymEfBulX98Y06wTI2IMcQnqCXZ5yay4,1066
22
+ jetson_examples-0.0.6.dist-info/METADATA,sha256=1Lk1wZMhjzDIOgcAFEFRyuNc8qf0NNp5PunBGRQDhGc,3982
23
+ jetson_examples-0.0.6.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
24
+ jetson_examples-0.0.6.dist-info/entry_points.txt,sha256=5-OdcBifoDjVXE9KjNoN6tQa8l_XSXhdbBEgL2hxeDM,58
25
+ jetson_examples-0.0.6.dist-info/top_level.txt,sha256=SI-liiUOkoGwOJfMP7d7k63JKgdcbiEj6DEC8QIKI90,11
26
+ jetson_examples-0.0.6.dist-info/RECORD,,
reComputer/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.0.4"
1
+ __version__ = "0.0.6"
reComputer/main.py CHANGED
@@ -8,21 +8,48 @@ def script(name):
8
8
  return script_path
9
9
 
10
10
 
11
+ def list_all_examples(folder_path):
12
+ directory_names = []
13
+ for item in os.listdir(folder_path):
14
+ item_path = os.path.join(folder_path, item)
15
+ if os.path.isdir(item_path):
16
+ directory_names.append(item)
17
+ return directory_names
18
+
19
+
11
20
  def run_script():
12
- # TODO: maybe use python instead of shell is better
21
+
13
22
  if len(sys.argv) == 3:
14
23
  if sys.argv[1] == "run":
15
24
  example_name = sys.argv[2]
25
+ # TODO: maybe use python instead of shell is better
16
26
  subprocess.run(["bash", script("run.sh"), example_name])
17
27
  else:
18
28
  print("Only Support `run` for now. try `reComputer run llava` .")
19
29
  elif len(sys.argv) == 2:
20
30
  if sys.argv[1] == "check":
21
31
  subprocess.run(["bash", script("check.sh")])
32
+ elif sys.argv[1] == "update":
33
+ subprocess.run(["bash", script("update.sh")])
34
+ elif sys.argv[1] == "list":
35
+ example_folder = os.path.join(os.path.dirname(__file__), "scripts")
36
+ directories = list_all_examples(example_folder)
37
+ print("example list:")
38
+ index = 1
39
+ for directory in directories:
40
+ print("{:03d}".format(index), "|", directory)
41
+ index += 1
42
+ print("-end-")
22
43
  else:
23
- print("Only Support `check` for now. try `reComputer check` .")
44
+ print("reComputer help:")
45
+ print("---")
46
+ print("`reComputer check` | check system.")
47
+ print("`reComputer update` | update jetson-ai-lab.")
48
+ print("`reComputer list` | list all examples.")
49
+ print("`reComputer run xxx` | run an example.")
50
+ print("---")
24
51
  else:
25
- print("Error Usage! try `reComputer run xxx` .")
52
+ print("Error Usage! try `reComputer help`.")
26
53
 
27
54
 
28
55
  if __name__ == "__main__":
@@ -0,0 +1,5 @@
1
+ #!/bin/bash
2
+
3
+ ./run.sh $(./autotag local_llm) \
4
+ python3 -m local_llm.chat --api=mlc \
5
+ --model princeton-nlp/Sheared-LLaMA-2.7B-ShareGPT
@@ -0,0 +1,3 @@
1
+ # hello-world
2
+
3
+ - print `hello-world` to show how to add your project into this package
@@ -0,0 +1,9 @@
1
+ #!/bin/bash
2
+ ./run.sh $(./autotag llava) \
3
+ python3 -m nano_llm.agents.video_query --api=mlc \
4
+ --model Efficient-Large-Model/VILA-2.7b \
5
+ --max-context-len 768 \
6
+ --max-new-tokens 32 \
7
+ --video-input /dev/video0 \
8
+ --video-output webrtc://@:8554/output \
9
+ --nanodb /data/nanodb/coco/2017
@@ -0,0 +1,10 @@
1
+ #!/bin/bash
2
+
3
+ # try stop old server
4
+ docker rm -f ollama
5
+ # start new server
6
+ ./run.sh -d --name ollama $(./autotag ollama)
7
+ # run a client
8
+ ./run.sh $(./autotag ollama) /bin/ollama run llama3
9
+ # clean new server
10
+ docker rm -f ollama
@@ -0,0 +1,6 @@
1
+ #!/bin/bash
2
+
3
+ ./run.sh $(./autotag llava) \
4
+ python3 -m llava.serve.cli \
5
+ --model-path liuhaotian/llava-v1.5-7b \
6
+ --image-file /data/images/hoover.jpg
@@ -0,0 +1,5 @@
1
+ #!/bin/bash
2
+ ./run.sh $(./autotag llava) \
3
+ python3 -m llava.serve.cli \
4
+ --model-path liuhaotian/llava-v1.5-7b \
5
+ --image-file /data/images/hoover.jpg
@@ -0,0 +1,6 @@
1
+ #!/bin/bash
2
+ ./run.sh $(./autotag local_llm) \
3
+ python3 -m local_llm --api=mlc \
4
+ --model liuhaotian/llava-v1.6-vicuna-7b \
5
+ --max-context-len 768 \
6
+ --max-new-tokens 128
@@ -0,0 +1,10 @@
1
+ # NanoDB
2
+
3
+ ## ref
4
+
5
+ - <https://www.jetson-ai-lab.com/tutorial_nanodb.html>
6
+
7
+ ## access
8
+
9
+ - using in machine, try `http://127.0.0.1:7860` in browser.
10
+ - using in other pc, make sure you know jetson's IP and try `http://<<Jetson's IP>>:7860` in browser.
@@ -0,0 +1,3 @@
1
+ #!/bin/bash
2
+
3
+ ./run.sh $(./autotag nanoowl) bash -c "ls /dev/video* && cd examples/tree_demo && python3 tree_demo.py ../../data/owl_image_encoder_patch32.engine"
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+
3
+ # try stop old server
4
+ docker rm -f ollama
5
+ # run Front-end
6
+ ./run.sh $(./autotag ollama)
7
+ # user only can access with http://ip:11434
reComputer/scripts/run.sh CHANGED
@@ -45,73 +45,29 @@ check_disk_space() {
45
45
 
46
46
  echo "run example:$1"
47
47
  BASE_PATH=/home/$USER/reComputer
48
+
48
49
  echo "----example init----"
49
50
  mkdir -p $BASE_PATH/
50
51
  JETSON_REPO_PATH="$BASE_PATH/jetson-containers"
52
+ BASE_JETSON_LAB_GIT="https://github.com/dusty-nv/jetson-containers/tree/d1573a3e8d7ba3fef36ebb23a7391e60eaf64db7"
51
53
  if [ -d $JETSON_REPO_PATH ]; then
52
54
  echo "jetson-ai-lab existed."
53
55
  else
54
56
  echo "jetson-ai-lab does not installed. start init..."
55
57
  cd $BASE_PATH/
56
- git clone --depth=1 https://github.com/dusty-nv/jetson-containers
58
+ git clone --depth=1 $BASE_JETSON_LAB_GIT
57
59
  cd $JETSON_REPO_PATH
58
60
  sudo apt update; sudo apt install -y python3-pip
59
61
  pip3 install -r requirements.txt
60
62
  fi
63
+
61
64
  echo "----example start----"
62
65
  cd $JETSON_REPO_PATH
63
- case "$1" in
64
- "llava")
65
- ./run.sh $(./autotag llava) \
66
- python3 -m llava.serve.cli \
67
- --model-path liuhaotian/llava-v1.5-7b \
68
- --image-file /data/images/hoover.jpg
69
- ;;
70
- "llava-v1.5-7b")
71
- ./run.sh $(./autotag llava) \
72
- python3 -m llava.serve.cli \
73
- --model-path liuhaotian/llava-v1.5-7b \
74
- --image-file /data/images/hoover.jpg
75
- ;;
76
- "llava-v1.6-vicuna-7b")
77
- ./run.sh $(./autotag local_llm) \
78
- python3 -m local_llm --api=mlc \
79
- --model liuhaotian/llava-v1.6-vicuna-7b \
80
- --max-context-len 768 \
81
- --max-new-tokens 128
82
- ;;
83
- "Sheared-LLaMA-2.7B-ShareGPT")
84
- ./run.sh $(./autotag local_llm) \
85
- python3 -m local_llm.chat --api=mlc \
86
- --model princeton-nlp/Sheared-LLaMA-2.7B-ShareGPT
87
- ;;
88
- "text-generation-webui")
89
- # download llm model
90
- ./run.sh --workdir=/opt/text-generation-webui $(./autotag text-generation-webui) /bin/bash -c \
91
- 'python3 download-model.py --output=/data/models/text-generation-webui TheBloke/Llama-2-7b-Chat-GPTQ'
92
- # run text-generation-webui
93
- ./run.sh $(./autotag text-generation-webui)
94
- ;;
95
- "stable-diffusion-webui")
96
- ./run.sh $(./autotag stable-diffusion-webui)
97
- ;;
98
- "nanoowl")
99
- ./run.sh $(./autotag nanoowl) bash -c "ls /dev/video* && cd examples/tree_demo && python3 tree_demo.py ../../data/owl_image_encoder_patch32.engine"
100
- ;;
101
- "whisper")
102
- ./run.sh $(./autotag whisper)
103
- ;;
104
- "nanodb")
105
- script_dir=$(dirname "$0")
106
- bash $script_dir/nanodb.sh
107
- ;;
108
- "live-llava")
109
- script_dir=$(dirname "$0")
110
- bash $script_dir/live-llava.sh
111
- ;;
112
- *)
113
- echo "Unknown example"
114
- # handle unknown
115
- ;;
116
- esac
66
+ script_dir=$(dirname "$0")
67
+ start_script=$script_dir/$1/run.sh
68
+ if [ -f $start_script ]; then
69
+ bash $start_script
70
+ else
71
+ echo "ERROR: Example[$1] Not Found."
72
+ fi
117
73
  echo "----example done----"
@@ -0,0 +1,3 @@
1
+ #!/bin/bash
2
+
3
+ ./run.sh $(./autotag stable-diffusion-webui)
@@ -0,0 +1,8 @@
1
+ #!/bin/bash
2
+
3
+ # download llm model
4
+ ./run.sh --workdir=/opt/text-generation-webui $(./autotag text-generation-webui) /bin/bash -c \
5
+ 'python3 download-model.py --output=/data/models/text-generation-webui TheBloke/Llama-2-7b-Chat-GPTQ'
6
+
7
+ # run text-generation-webui
8
+ ./run.sh $(./autotag text-generation-webui)
@@ -0,0 +1,27 @@
1
+ #!/bin/bash
2
+ echo "--update jetson-containers repo--"
3
+ BASE_PATH=/home/$USER/reComputer
4
+ mkdir -p $BASE_PATH/
5
+
6
+ JETSON_REPO_PATH="$BASE_PATH/jetson-containers"
7
+ BASE_JETSON_LAB_GIT="https://github.com/dusty-nv/jetson-containers/tree/d1573a3e8d7ba3fef36ebb23a7391e60eaf64db7"
8
+
9
+ if [ -d $JETSON_REPO_PATH ]; then
10
+ echo "jetson-ai-lab existed."
11
+ # 5 publish to Test PyPI
12
+ read -p "follow the newest version maybe bring bugs, are you sure about the update? (y/n): " choice
13
+ if [[ $choice == "y" || $choice == "Y" ]]; then
14
+ cd $JETSON_REPO_PATH
15
+ git pull
16
+ pip3 install -r requirements.txt
17
+ else
18
+ echo "skip update."
19
+ fi
20
+ else
21
+ echo "jetson-ai-lab does not installed. start init..."
22
+ cd $BASE_PATH/
23
+ git clone --depth=1 $BASE_JETSON_LAB_GIT
24
+ cd $JETSON_REPO_PATH
25
+ sudo apt update; sudo apt install -y python3-pip
26
+ pip3 install -r requirements.txt
27
+ fi
@@ -0,0 +1,3 @@
1
+ #!/bin/bash
2
+
3
+ ./run.sh $(./autotag whisper)
@@ -1,12 +0,0 @@
1
- reComputer/__init__.py,sha256=1mptEzQihbdyqqzMgdns_j5ZGK9gz7hR2bsgA_TnjO4,22
2
- reComputer/main.py,sha256=TRhzH30lOSPyWyAHSjlSe40BL2nBRz5-a5zQoRr595A,809
3
- reComputer/scripts/check.sh,sha256=cUMwAjHpgJoaD5a8gTLJG7QWjF9CyKPgQ-ewRNK3FD8,127
4
- reComputer/scripts/live-llava.sh,sha256=4sWld5d8Fkr9GUVqLH2S1RyOKOjobhjojSzuJu8EuCg,10137
5
- reComputer/scripts/nanodb.sh,sha256=6MKQgYqDhg-Rvh3Sk4sNm5V2jg1ZgtSVvB2fOjH_KuE,1875
6
- reComputer/scripts/run.sh,sha256=hVRRC-wwjrfUdwSIg_0XDlKWNcVq_CfVBZOReddJ7Ek,3585
7
- jetson_examples-0.0.4.dist-info/LICENSE,sha256=ac_LOi8ChcJhymEfBulX98Y06wTI2IMcQnqCXZ5yay4,1066
8
- jetson_examples-0.0.4.dist-info/METADATA,sha256=FZkx_NFvQOVHNyAv8GIaq-WwIISYe_3pHGg1ZyfvVK8,3903
9
- jetson_examples-0.0.4.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
10
- jetson_examples-0.0.4.dist-info/entry_points.txt,sha256=5-OdcBifoDjVXE9KjNoN6tQa8l_XSXhdbBEgL2hxeDM,58
11
- jetson_examples-0.0.4.dist-info/top_level.txt,sha256=SI-liiUOkoGwOJfMP7d7k63JKgdcbiEj6DEC8QIKI90,11
12
- jetson_examples-0.0.4.dist-info/RECORD,,
File without changes
File without changes