Browse Source

Minor refactoring

tags/v0.3.9-rc1
haixuantao 11 months ago
parent
commit
0f2361ba2f
5 changed files with 11 additions and 8 deletions
  1. +3
    -3
      node-hub/dora-qwen2-5-vl/README.md
  2. +0
    -0
      node-hub/dora-qwen2-5-vl/dora_qwen2_5_vl/__init__.py
  3. +5
    -2
      node-hub/dora-qwen2-5-vl/dora_qwen2_5_vl/main.py
  4. +2
    -2
      node-hub/dora-qwen2-5-vl/pyproject.toml
  5. +1
    -1
      node-hub/llama-factory-recorder/README.md

+ 3
- 3
node-hub/dora-qwen2-5-vl/README.md View File

@@ -1,4 +1,4 @@
# Dora QwenVL2 node
# Dora QwenVL2.5 node

Experimental node for using a VLM within dora.

@@ -8,8 +8,8 @@ This node is supposed to be used as follows:

```yaml
- id: dora-qwenvl
build: pip install dora-qwenvl
path: dora-qwenvl
build: pip install dora-qwen2-5-vl
path: dora-qwen2-5-vl
inputs:
image:
source: camera/image


node-hub/dora-qwen2-5-vl/dora_qwenvl/__init__.py → node-hub/dora-qwen2-5-vl/dora_qwen2_5_vl/__init__.py View File


node-hub/dora-qwen2-5-vl/dora_qwenvl/main.py → node-hub/dora-qwen2-5-vl/dora_qwen2_5_vl/main.py View File

@@ -152,6 +152,7 @@ def main():
],
},
]
cached_text = DEFAULT_QUESTION

for event in node:
event_type = event["type"]
@@ -198,17 +199,19 @@ def main():
image = Image.fromarray(frame)
frames[event_id] = image.resize((IMAGE_HEIGHT, IMAGE_WIDTH))

elif event_id == "text":
elif "text" in event_id:
if len(event["value"]) > 0:
text = event["value"][0].as_py()
else:
text = ""
text = cached_text
words = text.split()
if len(ACTIVATION_WORDS) > 0 and all(
word not in ACTIVATION_WORDS for word in words
):
continue

cached_text = text

if len(frames.keys()) == 0:
continue
# set the max number of tiles in `max_num`

+ 2
- 2
node-hub/dora-qwen2-5-vl/pyproject.toml View File

@@ -43,8 +43,8 @@ dev = ["pytest >=8.1.1", "ruff >=0.9.1"]
transformers = { git = "https://github.com/huggingface/transformers" }

[project.scripts]
dora-qwenvl = "dora_qwenvl.main:main"
dora-qwen2-5-vl = "dora_qwen2_5_vl.main:main"

[build-system]
requires = ["setuptools", "setuptools-scm", "torch"]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"

+ 1
- 1
node-hub/llama-factory-recorder/README.md View File

@@ -40,7 +40,7 @@ Example:

```yaml,diff
- model_name_or_path: Qwen/Qwen2-VL-7B-Instruct
+ model_name_or_path: Qwen/Qwen2-VL-2B-Instruct
+ model_name_or_path: Qwen/Qwen2.5-VL-3B-Instruct
```

- Then


Loading…
Cancel
Save