swarecito commited on
Commit
8dede70
·
verified ·
1 Parent(s): 0666409

Upload folder using huggingface_hub

Browse files
Files changed (35) hide show
  1. .venv/lib/python3.13/site-packages/pip/_vendor/__pycache__/typing_extensions.cpython-313.pyc +2 -2
  2. .venv/lib/python3.13/site-packages/pip/_vendor/distlib/t64-arm.exe +2 -2
  3. .venv/lib/python3.13/site-packages/pip/_vendor/distlib/t64.exe +2 -2
  4. .venv/lib/python3.13/site-packages/pip/_vendor/distlib/w64-arm.exe +2 -2
  5. .venv/lib/python3.13/site-packages/pip/_vendor/distlib/w64.exe +2 -2
  6. .venv/lib/python3.13/site-packages/pip/_vendor/idna/__pycache__/uts46data.cpython-313.pyc +2 -2
  7. .venv/lib/python3.13/site-packages/pip/_vendor/pkg_resources/__pycache__/__init__.cpython-313.pyc +2 -2
  8. .venv/lib/python3.13/site-packages/pip/_vendor/rich/__pycache__/_emoji_codes.cpython-313.pyc +2 -2
  9. .venv/lib/python3.13/site-packages/pip/_vendor/rich/__pycache__/console.cpython-313.pyc +2 -2
  10. handler.py +9 -6
  11. model.safetensors +2 -2
  12. onnx/decoder_model_merged.onnx +2 -2
  13. onnx/decoder_model_merged_bnb4.onnx +2 -2
  14. onnx/decoder_model_merged_fp16.onnx +2 -2
  15. onnx/decoder_model_merged_int8.onnx +2 -2
  16. onnx/decoder_model_merged_q4.onnx +2 -2
  17. onnx/decoder_model_merged_q4f16.onnx +2 -2
  18. onnx/decoder_model_merged_quantized.onnx +2 -2
  19. onnx/decoder_model_merged_uint8.onnx +2 -2
  20. onnx/embed_tokens.onnx +2 -2
  21. onnx/embed_tokens_bnb4.onnx +2 -2
  22. onnx/embed_tokens_fp16.onnx +2 -2
  23. onnx/embed_tokens_int8.onnx +2 -2
  24. onnx/embed_tokens_q4.onnx +2 -2
  25. onnx/embed_tokens_q4f16.onnx +2 -2
  26. onnx/embed_tokens_quantized.onnx +2 -2
  27. onnx/embed_tokens_uint8.onnx +2 -2
  28. onnx/vision_encoder.onnx +2 -2
  29. onnx/vision_encoder_bnb4.onnx +2 -2
  30. onnx/vision_encoder_fp16.onnx +2 -2
  31. onnx/vision_encoder_int8.onnx +2 -2
  32. onnx/vision_encoder_q4.onnx +2 -2
  33. onnx/vision_encoder_q4f16.onnx +2 -2
  34. onnx/vision_encoder_quantized.onnx +2 -2
  35. onnx/vision_encoder_uint8.onnx +2 -2
.venv/lib/python3.13/site-packages/pip/_vendor/__pycache__/typing_extensions.cpython-313.pyc CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:581775f475e5ab144217150bd7fd28ec093e844edee80051c588de519cda3d35
3
- size 178309
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fb9087a451da8e323704620adbed35e2250801ae721143b40c83bbaa42cddd7d
3
+ size 131
.venv/lib/python3.13/site-packages/pip/_vendor/distlib/t64-arm.exe CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:ebc4c06b7d95e74e315419ee7e88e1d0f71e9e9477538c00a93a9ff8c66a6cfc
3
- size 182784
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3acf055b7721a8fb88eda2055a19490da6ee29da37619e5a4b3e54e3f97691dc
3
+ size 131
.venv/lib/python3.13/site-packages/pip/_vendor/distlib/t64.exe CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:81a618f21cb87db9076134e70388b6e9cb7c2106739011b6a51772d22cae06b7
3
- size 108032
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:75f9bc0da6448a7b7038e1f46e75971171f4bade7eb2f389ff0daaae991f8ce0
3
+ size 131
.venv/lib/python3.13/site-packages/pip/_vendor/distlib/w64-arm.exe CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:c5dc9884a8f458371550e09bd396e5418bf375820a31b9899f6499bf391c7b2e
3
- size 168448
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bed493a6cd03ac2c8f12d915ffad94d5d023c3690355e1075b9fd5807a53d4a0
3
+ size 131
.venv/lib/python3.13/site-packages/pip/_vendor/distlib/w64.exe CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:7a319ffaba23a017d7b1e18ba726ba6c54c53d6446db55f92af53c279894f8ad
3
- size 101888
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5ff67381e07ad8423d60bde63668985125acf97c81fbfecf60f6351f783e715d
3
+ size 131
.venv/lib/python3.13/site-packages/pip/_vendor/idna/__pycache__/uts46data.cpython-313.pyc CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:c36205832e421a74ba54db507e3cf51b802634ce3c2647ab5cda7ec57d020f9a
3
- size 159062
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:653d4f099ea5e77f6057b8de254369131c9ba73dc845f8fac567f05d99e07a5b
3
+ size 131
.venv/lib/python3.13/site-packages/pip/_vendor/pkg_resources/__pycache__/__init__.cpython-313.pyc CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:f205a4557ee5f1a4b51594f1fdfe5e216291d962c8531eccbb9f226d9c7ecb1a
3
- size 161670
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cb9377f458939ad17eba4a6478a66afde8a2e6cdc2267b67b1d4ae3047d7d6e8
3
+ size 131
.venv/lib/python3.13/site-packages/pip/_vendor/rich/__pycache__/_emoji_codes.cpython-313.pyc CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:cddf31d11c325993931468c73fd8530b4e09b5c33651db326928ec202720353d
3
- size 206029
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:601711675bce2071988d44240c55229bc80be685fecf99ddd915d5cea926ede6
3
+ size 131
.venv/lib/python3.13/site-packages/pip/_vendor/rich/__pycache__/console.cpython-313.pyc CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:1e05e8d32d80dc37e073488146df3db7de9447d40b137af9e0d99f2d69418ffc
3
- size 114011
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aa41a232903fd67f826c9ef8b02d1ae866dfb2ebd6dddaffb60cc383c490989c
3
+ size 131
handler.py CHANGED
@@ -8,22 +8,25 @@ import os
8
 
9
  class EndpointHandler:
10
  def __init__(self, path=""):
11
- # Récupérer le token depuis les secrets de l'endpoint (bonne pratique)
12
  token = os.getenv("HUGGING_FACE_HUB_TOKEN")
 
 
 
13
 
14
- # Déterminer le device (le endpoint aura un GPU)
15
  self.device = "cuda" if torch.cuda.is_available() else "cpu"
16
  self.dtype = torch.bfloat16 if self.device == "cuda" else torch.float32
17
 
18
- # Charger le processeur et le modèle
19
- # Le `path` est l'endroit où le endpoint stocke les fichiers du modèle
20
- self.processor = AutoProcessor.from_pretrained(path, token=token)
21
  self.model = AutoModelForImageTextToText.from_pretrained(
22
- path,
23
  torch_dtype=self.dtype,
24
  token=token
25
  ).to(self.device)
26
 
 
 
27
  print("✅ Modèle et processeur chargés avec succès sur le device:", self.device)
28
 
29
  def __call__(self, data: dict) -> dict:
 
8
 
9
  class EndpointHandler:
10
  def __init__(self, path=""):
11
+ # Le token est automatiquement disponible pour les endpoints privés/protégés
12
  token = os.getenv("HUGGING_FACE_HUB_TOKEN")
13
+ # On spécifie quel modèle charger via une variable d'environnement
14
+ # Si elle n'est pas définie, on prend une valeur par défaut
15
+ model_id = os.getenv("MODEL_ID", "HuggingFaceTB/SmolVLM2-256M-Video-Instruct")
16
 
 
17
  self.device = "cuda" if torch.cuda.is_available() else "cpu"
18
  self.dtype = torch.bfloat16 if self.device == "cuda" else torch.float32
19
 
20
+ # Charger le processeur et le modèle DEPUIS L'ID DU MODÈLE ORIGINAL
21
+ self.processor = AutoProcessor.from_pretrained(model_id, token=token)
 
22
  self.model = AutoModelForImageTextToText.from_pretrained(
23
+ model_id,
24
  torch_dtype=self.dtype,
25
  token=token
26
  ).to(self.device)
27
 
28
+ print(f"✅ Modèle {model_id} chargé avec succès sur {self.device}")
29
+
30
  print("✅ Modèle et processeur chargés avec succès sur le device:", self.device)
31
 
32
  def __call__(self, data: dict) -> dict:
model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:b2a95ac1aea345a86aa2c4a822b8763e37d7bd7898d582fc49b9f7ac843eb3f5
3
- size 135
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2aa482312ec97ca3c7b02f86b9d7ec7098550af117ada5a55c498d35152369c1
3
+ size 128
onnx/decoder_model_merged.onnx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:1a07cd10bad40e5b60b79cd1a0653e247e1101af1d26c4410a95afec9dbddfda
3
- size 134
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1918fd61a53db7568768251583249968fad10ad84355e57d5b9d1a61aebe8198
3
+ size 128
onnx/decoder_model_merged_bnb4.onnx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:48540c869c16b7ebd4546bbca2dcd86cb6c228b0edf7adef9468de9c7121adc3
3
- size 133
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:91985286c412a3192904faa9e87fc06749d51fd80fbdea53de1ca943fdba4534
3
+ size 128
onnx/decoder_model_merged_fp16.onnx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:38eccf5509ab0f2aa7bb321166fb554aace43985c5136ab74bd69a0ec0528059
3
- size 134
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:db5cf3dccdcccf016b7fabd77a93240bb06fc350d51b5afbc8b3839b26f9bfe4
3
+ size 128
onnx/decoder_model_merged_int8.onnx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:22cd612e4af2483230f6d73b39dbfe5260fa1c101418522df4d954f55b7bd343
3
- size 134
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dac7061c42192a5794e21e902ea084f8aae30cf5d6a2d0f257e10ae06847704e
3
+ size 128
onnx/decoder_model_merged_q4.onnx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:c87ae884dabe1c8460bd2a057313ba1272344301fda75e50e490a7321fe6a90f
3
- size 133
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d9cfbd6e1335db31e82108f494136378cc6eec1557e9eb8e2a4cbc677bd58b1a
3
+ size 128
onnx/decoder_model_merged_q4f16.onnx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:54af04d97908b0d9dd131b3565ba87f64bf7f66bfbb32504611b5b8a2e69c162
3
- size 133
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d9f3672ce0308ed93cdcb13c859ebfbc390d0574934da3d0d8ef54118777506b
3
+ size 128
onnx/decoder_model_merged_quantized.onnx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:5b54045c9891c5201093f0ee75ca22ec7d6001405180c4758137c74a51885b67
3
- size 134
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:19e7be7e65ae38c163322d9bb75133acae4d409cbe27433922a48000815ea03c
3
+ size 128
onnx/decoder_model_merged_uint8.onnx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:5b54045c9891c5201093f0ee75ca22ec7d6001405180c4758137c74a51885b67
3
- size 134
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:19e7be7e65ae38c163322d9bb75133acae4d409cbe27433922a48000815ea03c
3
+ size 128
onnx/embed_tokens.onnx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:8d4e26f30832468c91308551058251de3217229ea636f97d47a564e88b992e05
3
- size 134
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d874107e0afe87a68d31984d9bc0aea2e0438791435a053be483f5499107bfb3
3
+ size 128
onnx/embed_tokens_bnb4.onnx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:9e566f3c02665796a31e8bc730ade810d7a78ad64199c3e09e91ff1d74d1591b
3
- size 134
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9e57d71556a9e5f157d1d2f918ada992cedeba04e0902030ab27f15e8ee8d1af
3
+ size 128
onnx/embed_tokens_fp16.onnx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:89966819da21dc8ff566b46dd7c3a7646fa54ec4a964bc772922c96923156614
3
- size 133
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a086ab3e79149ed33cf36340e41777508160aec4de8b895d65acbac6639ba42d
3
+ size 128
onnx/embed_tokens_int8.onnx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:24998c759c90470c61ef6a5631b6709f8d49bde111c365f5c5688dd6c39c2631
3
- size 133
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:03f4cb8f0496c188c0d665d2ba549654cfec3c65c074e7a1458ed8516d2ecd38
3
+ size 128
onnx/embed_tokens_q4.onnx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:9e566f3c02665796a31e8bc730ade810d7a78ad64199c3e09e91ff1d74d1591b
3
- size 134
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9e57d71556a9e5f157d1d2f918ada992cedeba04e0902030ab27f15e8ee8d1af
3
+ size 128
onnx/embed_tokens_q4f16.onnx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:2ed5b64f992ac964631153bb19675731faf243b22000b1b001be73a10ef58af5
3
- size 133
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7c9ed8d0115e725f9933da6a0d01373e79282dd4043985095efaebf59830a81b
3
+ size 128
onnx/embed_tokens_quantized.onnx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:24998c759c90470c61ef6a5631b6709f8d49bde111c365f5c5688dd6c39c2631
3
- size 133
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:03f4cb8f0496c188c0d665d2ba549654cfec3c65c074e7a1458ed8516d2ecd38
3
+ size 128
onnx/embed_tokens_uint8.onnx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:24998c759c90470c61ef6a5631b6709f8d49bde111c365f5c5688dd6c39c2631
3
- size 133
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:03f4cb8f0496c188c0d665d2ba549654cfec3c65c074e7a1458ed8516d2ecd38
3
+ size 128
onnx/vision_encoder.onnx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:54df7201d0df14b8ffd133c1441584acb42f21bf8dea23635f9890b9a3ec62e3
3
- size 134
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:108a5d50dfdd7f2f8c2ab37a22da0a583a53c549e37c2d18f0e47741b7477d0a
3
+ size 128
onnx/vision_encoder_bnb4.onnx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:bcf5b280a42b18065d7685ef669fc282cc44a0a5726dc51e83e7966e978954d7
3
- size 133
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dea301a422dcce529f269b17aa1b3d6012689563e39eb9e3a98e59d132aa4167
3
+ size 128
onnx/vision_encoder_fp16.onnx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:7ee01c50a1ec1a854456135b1557653f5878cf911c816e1e8ff533d743149c47
3
- size 134
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1562b681d619633fa4ced98ca72ad0c7e22c31bf888895805c8260d0a5d41de7
3
+ size 128
onnx/vision_encoder_int8.onnx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:708766d4d70a03b3ededbb7bb8d2e5d654b5a7be9cc39a1729f2cb726732a75b
3
- size 133
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6fc45323d14516eec9af11ca0a1599514ea031bbfdf283b29d66e7318c10c085
3
+ size 128
onnx/vision_encoder_q4.onnx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:f3aabd118b70e89bf33d7fe9bb1711c812f3881e8693ac1042a3438f70e6a96e
3
- size 133
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:504e686b21ca1fe925306292b3e59d5d2e294149488119b5bc13c4de8e484f52
3
+ size 128
onnx/vision_encoder_q4f16.onnx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:32f5f993bb9fbc0823b2741747b383023de8a90ec63085f1bc4ebc0d124adfee
3
- size 133
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f70954245085266c42da12ee432c396972844880fd90556f99a5f7015628a668
3
+ size 128
onnx/vision_encoder_quantized.onnx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:9262f3b99c5c875b9b8a48e830072b0bdcd63ec566f286db3b87fa133c3f8cef
3
- size 133
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:efd2f0fe74071c3b2a191a3b1ba7b617206a4010119b3545cba077eda75ab042
3
+ size 128
onnx/vision_encoder_uint8.onnx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:9262f3b99c5c875b9b8a48e830072b0bdcd63ec566f286db3b87fa133c3f8cef
3
- size 133
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:efd2f0fe74071c3b2a191a3b1ba7b617206a4010119b3545cba077eda75ab042
3
+ size 128