Translate to English
Browse files
app.py
CHANGED
@@ -15,18 +15,17 @@ processor = AutoProcessor.from_pretrained(
|
|
15 |
|
16 |
|
17 |
# Game rules
|
18 |
-
GAME_RULES = """In
|
19 |
-
|
20 |
-
|
21 |
-
Antworten Sie auf Deutsch.
|
22 |
"""
|
23 |
|
24 |
# Load one image
|
25 |
IMAGE_OPTIONS = {
|
26 |
-
"
|
27 |
-
"
|
28 |
-
"
|
29 |
-
"
|
30 |
}
|
31 |
|
32 |
# Function to run model
|
@@ -73,12 +72,12 @@ with gr.Blocks() as demo:
|
|
73 |
with gr.Column():
|
74 |
image_selector = gr.Dropdown(
|
75 |
choices=list(IMAGE_OPTIONS.keys()),
|
76 |
-
value="
|
77 |
-
label="
|
78 |
)
|
79 |
|
80 |
image_display = gr.Image(
|
81 |
-
value=Image.open(IMAGE_OPTIONS["
|
82 |
label="Ihr Bild",
|
83 |
interactive=False,
|
84 |
type="pil"
|
@@ -89,9 +88,9 @@ with gr.Blocks() as demo:
|
|
89 |
label="Ihre Beschreibung"
|
90 |
)
|
91 |
|
92 |
-
output_text = gr.Textbox(label="
|
93 |
|
94 |
-
play_button = gr.Button("
|
95 |
|
96 |
def update_image(selected_label):
|
97 |
selected_path = IMAGE_OPTIONS[selected_label]
|
|
|
15 |
|
16 |
|
17 |
# Game rules
|
18 |
+
GAME_RULES = """In this image you can see three color grids. In the following dialogue, the speaker will describe exactly one of the grids.
|
19 |
+
Please indicate to me whether he refers to the
|
20 |
+
left, middle, or right grid.
|
|
|
21 |
"""
|
22 |
|
23 |
# Load one image
|
24 |
IMAGE_OPTIONS = {
|
25 |
+
"Image 1": "example1.jpg",
|
26 |
+
"Image 2": "example2.jpg",
|
27 |
+
"Image 3": "example3.png",
|
28 |
+
"Image 4": "example4.jpg"
|
29 |
}
|
30 |
|
31 |
# Function to run model
|
|
|
72 |
with gr.Column():
|
73 |
image_selector = gr.Dropdown(
|
74 |
choices=list(IMAGE_OPTIONS.keys()),
|
75 |
+
value="Image 2",
|
76 |
+
label="Choose an image"
|
77 |
)
|
78 |
|
79 |
image_display = gr.Image(
|
80 |
+
value=Image.open(IMAGE_OPTIONS["Image 2"]),
|
81 |
label="Ihr Bild",
|
82 |
interactive=False,
|
83 |
type="pil"
|
|
|
88 |
label="Ihre Beschreibung"
|
89 |
)
|
90 |
|
91 |
+
output_text = gr.Textbox(label="Model's response")
|
92 |
|
93 |
+
play_button = gr.Button("start the game")
|
94 |
|
95 |
def update_image(selected_label):
|
96 |
selected_path = IMAGE_OPTIONS[selected_label]
|