Spaces:
Runtime error
Runtime error
Mehdi Cherti
commited on
Commit
·
c84aae2
1
Parent(s):
21418bd
update
Browse files- app.py +2 -1
- clip_encoder.py +2 -1
app.py
CHANGED
@@ -79,4 +79,5 @@ iface = gr.Interface(
|
|
79 |
],
|
80 |
outputs="image"
|
81 |
)
|
82 |
-
iface.launch(debug=True)
|
|
|
|
79 |
],
|
80 |
outputs="image"
|
81 |
)
|
82 |
+
#iface.launch(debug=True)
|
83 |
+
iface.queue(concurrency_count=8, max_size=100).launch(max_threads=8, debug=True)
|
clip_encoder.py
CHANGED
@@ -19,11 +19,12 @@ class CLIPEncoder(nn.Module):
|
|
19 |
pretrained = fname
|
20 |
model = "ViT-B-32"
|
21 |
pretrained = "openai"
|
22 |
-
|
23 |
self.model = model
|
24 |
|
25 |
self.pretrained = pretrained
|
26 |
self.model, _, _ = open_clip.create_model_and_transforms(model, pretrained=pretrained)
|
|
|
27 |
self.output_size = self.model.transformer.width
|
28 |
|
29 |
def forward(self, texts, return_only_pooled=False):
|
|
|
19 |
pretrained = fname
|
20 |
model = "ViT-B-32"
|
21 |
pretrained = "openai"
|
22 |
+
|
23 |
self.model = model
|
24 |
|
25 |
self.pretrained = pretrained
|
26 |
self.model, _, _ = open_clip.create_model_and_transforms(model, pretrained=pretrained)
|
27 |
+
print(self.model)
|
28 |
self.output_size = self.model.transformer.width
|
29 |
|
30 |
def forward(self, texts, return_only_pooled=False):
|