youssef commited on
Commit
1d168d5
·
1 Parent(s): 426a08c

new transformers

Browse files
Files changed (3) hide show
  1. Dockerfile +1 -1
  2. app.py +0 -29
  3. requirements.txt +1 -1
Dockerfile CHANGED
@@ -55,4 +55,4 @@ ENV PYTHONPATH=${HOME}/app \
55
  SYSTEM=spaces \
56
  FLASH_ATTENTION_SKIP_CUDA_BUILD=TRUE
57
 
58
- CMD ["python", "app.py"]
 
55
  SYSTEM=spaces \
56
  FLASH_ATTENTION_SKIP_CUDA_BUILD=TRUE
57
 
58
+ CMD ["python", "src/app.py"]
app.py DELETED
@@ -1,29 +0,0 @@
1
- import gradio as gr
2
- from src.video_processor.processor import VideoAnalyzer
3
- import logging
4
-
5
- logging.basicConfig(level=logging.INFO)
6
- logger = logging.getLogger(__name__)
7
-
8
- def process_video(video_path):
9
- try:
10
- analyzer = VideoAnalyzer()
11
- result = analyzer.process_video(video_path)
12
- return result[0]["description"]
13
- except Exception as e:
14
- logger.error(f"Error processing video: {str(e)}", exc_info=True)
15
- return f"Error processing video: {str(e)}"
16
-
17
- # Create Gradio interface
18
- demo = gr.Interface(
19
- fn=process_video,
20
- inputs=gr.Video(label="Upload your video"),
21
- outputs=gr.Textbox(label="Video Analysis", lines=10),
22
- title="Video Analysis with SmolVLM",
23
- description="Upload a video to get a detailed analysis of its content, including actions, events, timestamps, and important details.",
24
- examples=[], # You can add example videos here
25
- cache_examples=False
26
- )
27
-
28
- if __name__ == "__main__":
29
- demo.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
requirements.txt CHANGED
@@ -1,6 +1,6 @@
1
  torch==2.1.2
2
  torchvision==0.16.2
3
- transformers @ git+https://github.com/huggingface/transformers@v4.49.0-SmolVLM-2
4
  num2words==0.5.13
5
  gradio==4.19.2
6
  av==10.0.0
 
1
  torch==2.1.2
2
  torchvision==0.16.2
3
+ git+https://github.com/huggingface/transformers.git
4
  num2words==0.5.13
5
  gradio==4.19.2
6
  av==10.0.0