Commit ·
8db7bca
1
Parent(s): 84c6caf
update
Browse files- .python-version +1 -0
- main.py +24 -0
- pyproject.toml +27 -0
.python-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
3.11
|
main.py
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from pathlib import Path
|
| 2 |
+
|
| 3 |
+
import torch
|
| 4 |
+
from transformers import AutoModelForCausalLM, AutoProcessor
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
def main():
|
| 8 |
+
model_dir = Path(__file__).resolve().parent
|
| 9 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 10 |
+
model_dir,
|
| 11 |
+
trust_remote_code=True,
|
| 12 |
+
local_files_only=True,
|
| 13 |
+
torch_dtype=torch.bfloat16,
|
| 14 |
+
).eval()
|
| 15 |
+
processor = AutoProcessor.from_pretrained(
|
| 16 |
+
model_dir,
|
| 17 |
+
trust_remote_code=True,
|
| 18 |
+
local_files_only=True,
|
| 19 |
+
)
|
| 20 |
+
print(type(model).__name__, "loaded with", type(processor).__name__)
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
if __name__ == "__main__":
|
| 24 |
+
main()
|
pyproject.toml
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[project]
|
| 2 |
+
name = "openpangu-vl-7b"
|
| 3 |
+
version = "0.1.0"
|
| 4 |
+
description = "Add your description here"
|
| 5 |
+
readme = "README.md"
|
| 6 |
+
requires-python = ">=3.11"
|
| 7 |
+
|
| 8 |
+
dependencies = [
|
| 9 |
+
# "transformers>=4.51.3",
|
| 10 |
+
"diffusers>=0.27.2",
|
| 11 |
+
"huggingface-hub[hf-transfer,cli]>=0.34.2",
|
| 12 |
+
"einops>=0.8.0",
|
| 13 |
+
"opencv-python-headless>=4.9.0",
|
| 14 |
+
"av>=14.2.0,<16",
|
| 15 |
+
"torch>=2.2.1,<=2.7.1",
|
| 16 |
+
#"torchcodec>=0.5.0",
|
| 17 |
+
"torchvision>=0.21.0",
|
| 18 |
+
"qwen-vl-utils>=0.0.14",
|
| 19 |
+
"packaging>=24.2",
|
| 20 |
+
"ipython>=9.10.0",
|
| 21 |
+
#"torch-npu>=2.7.1.post2",
|
| 22 |
+
# "torch==2.5.1",
|
| 23 |
+
# "torch_npu==2.5.1",
|
| 24 |
+
"transformers==4.53.2",
|
| 25 |
+
# "qwen_vl_utils==0.0.14",
|
| 26 |
+
"sentencepiece>=0.2.1",
|
| 27 |
+
]
|