Spaces:
Running
on
Zero
Running
on
Zero
zhangbofei
commited on
Commit
·
a440324
1
Parent(s):
9a092ba
feat: push
Browse files- .gitignore +2 -0
- .python-version +1 -0
- app.py +4 -2
- app_config.yaml +2 -0
- app_store.png +0 -3
- apple_music.png +0 -3
- chrome.png +0 -0
- pyproject.toml +16 -0
- requirements.txt +8 -7
- safari_google.png +0 -3
- tongui.egg-info/PKG-INFO +27 -0
- tongui.egg-info/SOURCES.txt +8 -0
- tongui.egg-info/dependency_links.txt +1 -0
- tongui.egg-info/requires.txt +8 -0
- tongui.egg-info/top_level.txt +1 -0
- uv.lock +0 -0
.gitignore
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
.venv
|
2 |
+
/*.png
|
.python-version
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
3.12
|
app.py
CHANGED
@@ -13,10 +13,12 @@ from qwen_vl_utils import process_vision_info
|
|
13 |
from transformers import (
|
14 |
AutoProcessor,
|
15 |
)
|
|
|
16 |
|
17 |
from transformers import Qwen2_5_VLForConditionalGeneration, AutoConfig
|
18 |
from peft.peft_model import PeftModel
|
19 |
|
|
|
20 |
def load_model_and_processor(model_path, lora_path=None, merge_lora=True):
|
21 |
"""
|
22 |
Load the Qwen2.5-VL model and processor with optional LoRA weights.
|
@@ -72,8 +74,8 @@ MIN_PIXELS = 256 * 28 * 28
|
|
72 |
MAX_PIXELS = 1344 * 28 * 28
|
73 |
|
74 |
processor, model = load_model_and_processor(
|
75 |
-
model_path=
|
76 |
-
lora_path=
|
77 |
merge_lora=True,
|
78 |
)
|
79 |
# Helper functions
|
|
|
13 |
from transformers import (
|
14 |
AutoProcessor,
|
15 |
)
|
16 |
+
from omegaconf import OmegaConf
|
17 |
|
18 |
from transformers import Qwen2_5_VLForConditionalGeneration, AutoConfig
|
19 |
from peft.peft_model import PeftModel
|
20 |
|
21 |
+
config = OmegaConf.load("app_config.yaml")
|
22 |
def load_model_and_processor(model_path, lora_path=None, merge_lora=True):
|
23 |
"""
|
24 |
Load the Qwen2.5-VL model and processor with optional LoRA weights.
|
|
|
74 |
MAX_PIXELS = 1344 * 28 * 28
|
75 |
|
76 |
processor, model = load_model_and_processor(
|
77 |
+
model_path=config.model,
|
78 |
+
lora_path=config.lora_path,
|
79 |
merge_lora=True,
|
80 |
)
|
81 |
# Helper functions
|
app_config.yaml
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
model: Qwen/Qwen2.5-VL-3B-Instruct
|
2 |
+
lora_path: Bofeee5675/TongUI-3B
|
app_store.png
DELETED
Git LFS Details
|
apple_music.png
DELETED
Git LFS Details
|
chrome.png
DELETED
Binary file (67.6 kB)
|
|
pyproject.toml
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[project]
|
2 |
+
name = "tongui"
|
3 |
+
version = "0.1.0"
|
4 |
+
description = "Add your description here"
|
5 |
+
readme = "README.md"
|
6 |
+
requires-python = ">=3.12"
|
7 |
+
dependencies = [
|
8 |
+
"gradio>=5.25.2",
|
9 |
+
"omegaconf>=2.3.0",
|
10 |
+
"peft>=0.15.2",
|
11 |
+
"pip-tools>=7.4.1",
|
12 |
+
"qwen-vl-utils>=0.0.10",
|
13 |
+
"spaces>=0.35.0",
|
14 |
+
"torch>=2.6.0",
|
15 |
+
"torchvision>=0.21.0",
|
16 |
+
]
|
requirements.txt
CHANGED
@@ -1,7 +1,8 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
|
|
|
1 |
+
gradio>=5.25.2
|
2 |
+
omegaconf>=2.3.0
|
3 |
+
peft>=0.15.2
|
4 |
+
pip-tools>=7.4.1
|
5 |
+
qwen-vl-utils>=0.0.10
|
6 |
+
spaces>=0.35.0
|
7 |
+
torch>=2.6.0
|
8 |
+
torchvision>=0.21.0
|
safari_google.png
DELETED
Git LFS Details
|
tongui.egg-info/PKG-INFO
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Metadata-Version: 2.4
|
2 |
+
Name: tongui
|
3 |
+
Version: 0.1.0
|
4 |
+
Summary: Add your description here
|
5 |
+
Requires-Python: >=3.12
|
6 |
+
Description-Content-Type: text/markdown
|
7 |
+
Requires-Dist: gradio>=5.25.2
|
8 |
+
Requires-Dist: omegaconf>=2.3.0
|
9 |
+
Requires-Dist: peft>=0.15.2
|
10 |
+
Requires-Dist: pip-tools>=7.4.1
|
11 |
+
Requires-Dist: qwen-vl-utils>=0.0.10
|
12 |
+
Requires-Dist: spaces>=0.35.0
|
13 |
+
Requires-Dist: torch>=2.6.0
|
14 |
+
Requires-Dist: torchvision>=0.21.0
|
15 |
+
|
16 |
+
---
|
17 |
+
title: TongUI
|
18 |
+
emoji: 💬
|
19 |
+
colorFrom: yellow
|
20 |
+
colorTo: purple
|
21 |
+
sdk: gradio
|
22 |
+
sdk_version: 5.0.1
|
23 |
+
app_file: app.py
|
24 |
+
pinned: false
|
25 |
+
---
|
26 |
+
|
27 |
+
An example chatbot using [Gradio](https://gradio.app), [`huggingface_hub`](https://huggingface.co/docs/huggingface_hub/v0.22.2/en/index), and the [Hugging Face Inference API](https://huggingface.co/docs/api-inference/index).
|
tongui.egg-info/SOURCES.txt
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
README.md
|
2 |
+
app.py
|
3 |
+
pyproject.toml
|
4 |
+
tongui.egg-info/PKG-INFO
|
5 |
+
tongui.egg-info/SOURCES.txt
|
6 |
+
tongui.egg-info/dependency_links.txt
|
7 |
+
tongui.egg-info/requires.txt
|
8 |
+
tongui.egg-info/top_level.txt
|
tongui.egg-info/dependency_links.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
|
tongui.egg-info/requires.txt
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
gradio>=5.25.2
|
2 |
+
omegaconf>=2.3.0
|
3 |
+
peft>=0.15.2
|
4 |
+
pip-tools>=7.4.1
|
5 |
+
qwen-vl-utils>=0.0.10
|
6 |
+
spaces>=0.35.0
|
7 |
+
torch>=2.6.0
|
8 |
+
torchvision>=0.21.0
|
tongui.egg-info/top_level.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
app
|
uv.lock
ADDED
The diff for this file is too large to render.
See raw diff
|
|