yejunliang23 commited on
Commit
3d36a53
·
unverified ·
1 Parent(s): 2de1404

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -0
app.py CHANGED
@@ -9,6 +9,16 @@ from trimesh.exchange.gltf import export_glb
9
  import numpy as np
10
  import tempfile
11
  import copy
 
 
 
 
 
 
 
 
 
 
12
  def predict(_chatbot, task_history):
13
  chat_query = _chatbot[-1][0]
14
  query = task_history[-1][0]
 
9
  import numpy as np
10
  import tempfile
11
  import copy
12
+
13
+ def _remove_image_special(text):
14
+ text = text.replace('<ref>', '').replace('</ref>', '')
15
+ return re.sub(r'<box>.*?(</box>|$)', '', text)
16
+
17
+
18
+ def is_video_file(filename):
19
+ video_extensions = ['.mp4', '.avi', '.mkv', '.mov', '.wmv', '.flv', '.webm', '.mpeg']
20
+ return any(filename.lower().endswith(ext) for ext in video_extensions)
21
+
22
  def predict(_chatbot, task_history):
23
  chat_query = _chatbot[-1][0]
24
  query = task_history[-1][0]