bidit commited on
Commit
e504141
·
1 Parent(s): f08e044

Test Gradio

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -3,7 +3,7 @@ import torchvision.transforms as transforms
3
  import cv2
4
  from PIL import Image
5
  import pafy
6
- import gradio as gr
7
  from transformers import BlipProcessor, BlipForConditionalGeneration
8
  import subprocess
9
 
@@ -44,10 +44,13 @@ def caption_youtube(url):
44
  # Release the video file
45
 
46
  cap.release()
 
 
 
47
 
48
  video_url = 'https://www.youtube.com/watch?v=orbkg5JH9C8'
49
  subprocess.call(['youtube-dl', '-f', 'best', '-o', 'video.mp4', video_url]
50
- iface = gr.Interface(fn=caption_youtube, inputs='text', outputs="text")
51
  iface.launch()
52
 
53
 
 
3
  import cv2
4
  from PIL import Image
5
  import pafy
6
+ import gradio as gra
7
  from transformers import BlipProcessor, BlipForConditionalGeneration
8
  import subprocess
9
 
 
44
  # Release the video file
45
 
46
  cap.release()
47
+
48
+ def user_greeting(name):
49
+ return "Hi! " + name + " Welcome to your first Gradio application!😎"
50
 
51
  video_url = 'https://www.youtube.com/watch?v=orbkg5JH9C8'
52
  subprocess.call(['youtube-dl', '-f', 'best', '-o', 'video.mp4', video_url]
53
+ iface = gra.Interface(fn=user_greeting, inputs='text', outputs="text")
54
  iface.launch()
55
 
56