immanuelpeter commited on
Commit
c0b8a0a
·
verified ·
1 Parent(s): 9783c02

Sync card, example, and manifest with GitHub main

Browse files
Files changed (1) hide show
  1. examples/inference.py +4 -3
examples/inference.py CHANGED
@@ -1,6 +1,6 @@
1
  import argparse
2
  from pathlib import Path
3
- import sys
4
 
5
  from PIL import Image
6
  import torch
@@ -8,8 +8,9 @@ from huggingface_hub import hf_hub_download
8
  from safetensors.torch import load_file
9
  from torchvision import transforms
10
 
11
- sys.path.insert(0, str(Path(__file__).absolute().parents[1]))
12
- from vision import Aligner, ViT
 
13
 
14
 
15
  MODEL_ID = "immanuelpeter/DeepSeek-ViT"
 
1
  import argparse
2
  from pathlib import Path
3
+ import runpy
4
 
5
  from PIL import Image
6
  import torch
 
8
  from safetensors.torch import load_file
9
  from torchvision import transforms
10
 
11
+ BUNDLE = Path(__file__).absolute().parents[1]
12
+ module = runpy.run_path(str(BUNDLE / "vision.py"))
13
+ Aligner, ViT = module["Aligner"], module["ViT"]
14
 
15
 
16
  MODEL_ID = "immanuelpeter/DeepSeek-ViT"