suryabbrj commited on
Commit
dab9017
·
1 Parent(s): 1ed7018

removed unwanted indents and comments to clean up the code for submission

Browse files
Files changed (1) hide show
  1. app.py +0 -19
app.py CHANGED
@@ -1,31 +1,12 @@
1
  import gradio as gr
2
  from transformers import pipeline
3
- # install gradio library for the ui
4
- #!pip install -q gradio
5
-
6
- # install transformers to include pipeline to import and run pretrained image-to-text model.
7
- #!pip install transformers
8
-
9
- # ignore model warnings from logging to the console.
10
  import warnings
11
  import logging
12
  warnings.simplefilter('ignore')
13
  logging.disable(logging.WARNING)
14
 
15
- # import pipeline function from transformers.
16
-
17
- # import gradio to begin wrapping ui to the function model.
18
-
19
- # import pretrained model and its weights to the predict funtion [this is an optional step that may help speed up prediction by caching the weights to the ml platform. this only logs the prediction to the console, and thus the prediction is not entirely useful in application.]
20
  cap = pipeline('image-to-text')
21
 
22
- # uncomment and pass any url/path to the var img and invoke function to predict the caption.
23
-
24
- # url = 'https://cdn.pixabay.com/photo/2023/02/25/12/30/man-7813108_960_720.jpg'
25
- # cap(url)
26
-
27
- # add sentiment analysis to the caption to identify possible suicidal and depression symptoms!!
28
-
29
 
30
  def predict(image):
31
  cap = pipeline('image-to-text')
 
1
  import gradio as gr
2
  from transformers import pipeline
 
 
 
 
 
 
 
3
  import warnings
4
  import logging
5
  warnings.simplefilter('ignore')
6
  logging.disable(logging.WARNING)
7
 
 
 
 
 
 
8
  cap = pipeline('image-to-text')
9
 
 
 
 
 
 
 
 
10
 
11
  def predict(image):
12
  cap = pipeline('image-to-text')