Spaces:
Runtime error
Runtime error
anas-awadalla
commited on
Commit
•
7b6d0c9
1
Parent(s):
db61bc8
different examples
Browse files
app.py
CHANGED
@@ -8,7 +8,7 @@ login(token=os.environ["HUGGINGFACE_TOKEN"])
|
|
8 |
|
9 |
demo_imgs = [
|
10 |
["images/chinchilla_web-1024x683.jpg", "images/shiba-inu-dog-in-the-snow.jpg", "images/900.jpeg", "images/dogs.jpeg"],
|
11 |
-
["images/
|
12 |
["images/COCO_train2014_000000572279.jpg", "images/COCO_train2014_000000194806.jpg", "images/istockphoto-622434332-1024x1024.jpg", "images/11887_pesto-pasta_Rita-1x1-1-501c953b29074ab193e2b5ad36e64648.jpg"],
|
13 |
[
|
14 |
"images/bcee7a-20190225-a-london-underground-sign.jpg",
|
@@ -25,10 +25,10 @@ demo_texts = [
|
|
25 |
"Output: These are labrador retrievers. They are found in the UK.",
|
26 |
],
|
27 |
[
|
28 |
-
"Output: a pink flamingo standing in a body of water.",
|
29 |
"Output: a bowl filled with creamy hummus placed on a white countertop.",
|
30 |
-
"Output: a red and blue 'Underground' sign found in London",
|
31 |
-
"Output:
|
|
|
32 |
],
|
33 |
[
|
34 |
"Question: Describe the scene. Answer: A white airplane being repaired on the runway. 'Cargo' is written on it in red.",
|
@@ -156,7 +156,7 @@ def generate(
|
|
156 |
vision_x=vision_x,
|
157 |
lang_x=input_ids,
|
158 |
attention_mask=attention_mask,
|
159 |
-
max_new_tokens=
|
160 |
num_beams=5,
|
161 |
do_sample=True,
|
162 |
top_p=0.95,
|
@@ -199,6 +199,7 @@ with gr.Blocks() as demo:
|
|
199 |
# 🦩 OpenFlamingo Demo
|
200 |
|
201 |
Blog posts: #1 [An open-source framework for training vision-language models with in-context learning](https://laion.ai/blog/open-flamingo/) // #2 [OpenFlamingo v2: New Models and Enhanced Training Setup]()
|
|
|
202 |
GitHub: [open_flamingo](https://github.com/mlfoundations/open_flamingo)
|
203 |
|
204 |
In this demo we implement an interactive interface that showcases the in-context learning capabilities of the OpenFlamingo-4B model, a large multimodal model trained on top of RedPajama-INCITE-Instruct-3B-v1.
|
|
|
8 |
|
9 |
demo_imgs = [
|
10 |
["images/chinchilla_web-1024x683.jpg", "images/shiba-inu-dog-in-the-snow.jpg", "images/900.jpeg", "images/dogs.jpeg"],
|
11 |
+
["images/hummus.jpg", "images/london-underground-sign.jpg", "images/4645808729_2dfc59b6a5_z.jpg", "images/5944609705_4664531909_z.jpg"],
|
12 |
["images/COCO_train2014_000000572279.jpg", "images/COCO_train2014_000000194806.jpg", "images/istockphoto-622434332-1024x1024.jpg", "images/11887_pesto-pasta_Rita-1x1-1-501c953b29074ab193e2b5ad36e64648.jpg"],
|
13 |
[
|
14 |
"images/bcee7a-20190225-a-london-underground-sign.jpg",
|
|
|
25 |
"Output: These are labrador retrievers. They are found in the UK.",
|
26 |
],
|
27 |
[
|
|
|
28 |
"Output: a bowl filled with creamy hummus placed on a white countertop.",
|
29 |
+
"Output: a red and blue 'Underground' sign found in London.",
|
30 |
+
"Output: a man and a woman on a train looking at their cell phones.",
|
31 |
+
"Output: a lavish reception room with black and white tiled floor."
|
32 |
],
|
33 |
[
|
34 |
"Question: Describe the scene. Answer: A white airplane being repaired on the runway. 'Cargo' is written on it in red.",
|
|
|
156 |
vision_x=vision_x,
|
157 |
lang_x=input_ids,
|
158 |
attention_mask=attention_mask,
|
159 |
+
max_new_tokens=30,
|
160 |
num_beams=5,
|
161 |
do_sample=True,
|
162 |
top_p=0.95,
|
|
|
199 |
# 🦩 OpenFlamingo Demo
|
200 |
|
201 |
Blog posts: #1 [An open-source framework for training vision-language models with in-context learning](https://laion.ai/blog/open-flamingo/) // #2 [OpenFlamingo v2: New Models and Enhanced Training Setup]()
|
202 |
+
|
203 |
GitHub: [open_flamingo](https://github.com/mlfoundations/open_flamingo)
|
204 |
|
205 |
In this demo we implement an interactive interface that showcases the in-context learning capabilities of the OpenFlamingo-4B model, a large multimodal model trained on top of RedPajama-INCITE-Instruct-3B-v1.
|