autonomous019 commited on
Commit
ff7eae9
1 Parent(s): 0ef83dc

attempting gradio parallel

Browse files
Files changed (1) hide show
  1. app.py +17 -1
app.py CHANGED
@@ -4,6 +4,7 @@ from PIL import Image
4
  import requests
5
  import matplotlib.pyplot as plt
6
  import gradio as gr
 
7
  from transformers import ImageClassificationPipeline, PerceiverForImageClassificationConvProcessing, PerceiverFeatureExtractor
8
  from transformers import VisionEncoderDecoderModel
9
  from transformers import AutoTokenizer
@@ -90,8 +91,23 @@ description = "Demo for classifying images with Perceiver IO. To use it, simply
90
  article = "<p style='text-align: center'></p>"
91
 
92
  #gr.Interface(fn=classify_image, inputs=image, outputs=label, title=title, description=description, examples="", enable_queue=True).launch(debug=True)
93
- gr.Interface([classify_image,self_caption], inputs=image, outputs=label, title=title, description=description, examples="", enable_queue=True).launch(debug=True)
94
 
 
 
 
 
 
 
 
 
 
 
 
 
95
 
 
 
 
 
96
 
97
 
 
4
  import requests
5
  import matplotlib.pyplot as plt
6
  import gradio as gr
7
+ from gradio.mix import Parallel
8
  from transformers import ImageClassificationPipeline, PerceiverForImageClassificationConvProcessing, PerceiverFeatureExtractor
9
  from transformers import VisionEncoderDecoderModel
10
  from transformers import AutoTokenizer
 
91
  article = "<p style='text-align: center'></p>"
92
 
93
  #gr.Interface(fn=classify_image, inputs=image, outputs=label, title=title, description=description, examples="", enable_queue=True).launch(debug=True)
 
94
 
95
+ img_info1 = gr.Interface(
96
+ fn=classify_image,
97
+ inputs=image,
98
+ outputs=label,
99
+ )
100
+ img_info2 = gr.Interface(
101
+ fn=self_caption,
102
+ inputs=image,
103
+ outputs=label,
104
+ )
105
+
106
+ gr.Interface([classify_image,self_caption], inputs=image, outputs=label, title=title, description=description, examples="", enable_queue=True).launch(debug=True)
107
 
108
+ Parallel(
109
+ img_info1,
110
+ img_info2,
111
+ inputs=image, outputs=label, title=title, description=description, examples="", enable_queue=True).launch(debug=True)
112
 
113