Spaces:
Runtime error
Runtime error
Patch transformers bug
Browse files
app.py
CHANGED
|
@@ -2,6 +2,15 @@ import gradio as gr
|
|
| 2 |
from transformers import AutoProcessor, Glm4vForConditionalGeneration
|
| 3 |
import torch
|
| 4 |
from PIL import Image
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
# Configuration
|
| 7 |
MODEL_PATH = "zai-org/GLM-4.6V-Flash"
|
|
|
|
| 2 |
from transformers import AutoProcessor, Glm4vForConditionalGeneration
|
| 3 |
import torch
|
| 4 |
from PIL import Image
|
| 5 |
+
import os
|
| 6 |
+
|
| 7 |
+
# Monkey patch for transformers 5.0.0rc+ bug (NoneType iterable in video_processing)
|
| 8 |
+
try:
|
| 9 |
+
import transformers.models.auto.video_processing_auto as vpa
|
| 10 |
+
if not hasattr(vpa, "extractors") or vpa.extractors is None:
|
| 11 |
+
vpa.extractors = {}
|
| 12 |
+
except ImportError:
|
| 13 |
+
pass
|
| 14 |
|
| 15 |
# Configuration
|
| 16 |
MODEL_PATH = "zai-org/GLM-4.6V-Flash"
|