Skip to content

Commit 59a75b4

Browse files
committed
fix image_path
1 parent 6e46b76 commit 59a75b4

File tree

2 files changed

+24
-22
lines changed

2 files changed

+24
-22
lines changed

st_engine/data/prompts/1.jsonl

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
{"id":"1","prompt":["每个骰子的值是什么"],"language":"cn"}
2-
{"id":"2","prompt":["这张照片有几个人、几只狗?"],"language":"cn"}
3-
{"id":"3","prompt":["I will give you some pictures, and the pictures are in different art styles listed following. Which kind of art style does each uploaded picture belong to? Give the answer in the format: Picture {#NO} -> {#STYLE}. The STYLE should be exactly one of the listed kinds of art style I give to you. If you can not tell which one, the STYLE should be ‘unknown’. The listed art styles are (separated by ;): Egyptian Art;Greek Art;Roman Art;Byzantine Art;Romanesque Art;Gothic Art;Early Christian Art;Islamic Art;Carolingian Art;Ottonian Art;Pre-Romanesque Art;Insular Art;Minoan Art;Hiberno-Saxon Art;Mycenaean Art;Viking Art;Celtic Art;Coptic Art;Macedonian Art;Persian Art;Etruscan Art;Chinese Art;Japanese Art (Heian period);Indian Art (Gupta period);Pre-Columbian Art;Rococo;Neoclassicism;Romanticism;Genre Painting;Portraiture;Hudson River School;Realism;Pre-Raphaelite Brotherhood;Impressionism;Post-Impressionism;Symbolism;Art Nouveau;Orientalism;Landscape Painting;Fauvism;Cubism;Expressionism;Academic Art;Dada;Surrealism;Abstract Expressionism;Pop Art;Op Art;Minimalism;Conceptual Art;Stukism;Photorealism;Street Art;Digital Art;New Media Art;Hyperrealism;Post-Internet Art;Insta-Art/Social Media Art"],"language":"en"}
4-
{"id":"4","prompt":["我家是中式装修风格,我想给客厅挑一个沙发,我选哪个比较好?"],"language":"cn"}
5-
{"id":"5","prompt":["描述下这张图片的内容"],"language":"cn"}
6-
{"id":"6","prompt":["Please identify and label all objects in the following image."],"language":"en"}
7-
{"id":"7","prompt":["Please read the text in this image and return the information in the following JSON format (note xxx is a placeholder, if the information is not available in the image, put 'N/A' instead). {'Surname': xxx, 'Given Name': xxx, 'uSCls #': xxx, 'Category': xxx, 'Country of Birh': xxx, 'Date of Birth': xxx, 'SEX': xxx, 'Card Expires': xxx, 'Resident Since': xxx}"],"language":"en"}
8-
{"id":"8","prompt":["图中内容的markdown格式是什么样子的"],"language":"cn"}
9-
{"id":"9","prompt":["Could you please provide a brief introduction to the distinct architectural landmarks of the city in the image?"],"language":"en"}
10-
{"id":"10","prompt":["我老花看不清字,而且对花生过敏,请你帮我看看我能吃这个吗?"],"language":"cn"}
11-
{"id":"11","prompt":["在图片中,穿黑色球衣的球员和穿绿色球衣的球员谁离足球更近?"],"language":"cn"}
12-
{"id":"12","prompt":["分析一下这个图片"],"language":"cn"}
13-
{"id":"13","prompt":["What are the consequences of the easy decisions shown in this image?"],"language":"en"}
14-
{"id":"14","prompt":["Based on this image, please predict what will happen next?"],"language":"en"}
15-
{"id":"15","prompt":["左边给定的是纸盒的外表面,下面哪一项不能由它折叠而成?"],"language":"cn"}
16-
{"id":"16","prompt":["用python实现这个流程图"],"language":"cn"}
17-
{"id":"17","prompt":["图中解题过程有误,请你给我一个简洁的解答过程以及答案"],"language":"cn"}
18-
{"id":"18","prompt":["简单解释一下图中糕点的烘烤过程"],"language":"cn"}
19-
{"id":"19","prompt":["给图中的商品生成一段广告语"],"language":"cn"}
20-
{"id":"20","prompt":["Can you be my tour guide and give me a brief introduction to this city and its attractions?"],"language":"en"}
1+
{"id":"1","prompt":["每个骰子的值是什么"],"image_path":["1.png"],"language":"cn"}
2+
{"id":"2","prompt":["这张照片有几个人、几只狗?"],"image_path":["2.png"],"language":"cn"}
3+
{"id":"3","prompt":["I will give you some pictures, and the pictures are in different art styles listed following. Which kind of art style does each uploaded picture belong to? Give the answer in the format: Picture {#NO} -> {#STYLE}. The STYLE should be exactly one of the listed kinds of art style I give to you. If you can not tell which one, the STYLE should be ‘unknown’. The listed art styles are (separated by ;): Egyptian Art;Greek Art;Roman Art;Byzantine Art;Romanesque Art;Gothic Art;Early Christian Art;Islamic Art;Carolingian Art;Ottonian Art;Pre-Romanesque Art;Insular Art;Minoan Art;Hiberno-Saxon Art;Mycenaean Art;Viking Art;Celtic Art;Coptic Art;Macedonian Art;Persian Art;Etruscan Art;Chinese Art;Japanese Art (Heian period);Indian Art (Gupta period);Pre-Columbian Art;Rococo;Neoclassicism;Romanticism;Genre Painting;Portraiture;Hudson River School;Realism;Pre-Raphaelite Brotherhood;Impressionism;Post-Impressionism;Symbolism;Art Nouveau;Orientalism;Landscape Painting;Fauvism;Cubism;Expressionism;Academic Art;Dada;Surrealism;Abstract Expressionism;Pop Art;Op Art;Minimalism;Conceptual Art;Stukism;Photorealism;Street Art;Digital Art;New Media Art;Hyperrealism;Post-Internet Art;Insta-Art/Social Media Art"],"image_path":["3.png"],"language":"en"}
4+
{"id":"4","prompt":["我家是中式装修风格,我想给客厅挑一个沙发,我选哪个比较好?"],"image_path":["4.png"],"language":"cn"}
5+
{"id":"5","prompt":["描述下这张图片的内容"],"image_path":["5.png"],"language":"cn"}
6+
{"id":"6","prompt":["Please identify and label all objects in the following image."],"image_path":["6.png"],"language":"en"}
7+
{"id":"7","prompt":["Please read the text in this image and return the information in the following JSON format (note xxx is a placeholder, if the information is not available in the image, put 'N/A' instead). {'Surname': xxx, 'Given Name': xxx, 'uSCls #': xxx, 'Category': xxx, 'Country of Birh': xxx, 'Date of Birth': xxx, 'SEX': xxx, 'Card Expires': xxx, 'Resident Since': xxx}"],"image_path":["7.png"],"language":"en"}
8+
{"id":"8","prompt":["图中内容的markdown格式是什么样子的"],"image_path":["8.png"],"language":"cn"}
9+
{"id":"9","prompt":["Could you please provide a brief introduction to the distinct architectural landmarks of the city in the image?"],"image_path":["9.png"],"language":"en"}
10+
{"id":"10","prompt":["我老花看不清字,而且对花生过敏,请你帮我看看我能吃这个吗?"],"image_path":["10.png"],"language":"cn"}
11+
{"id":"11","prompt":["在图片中,穿黑色球衣的球员和穿绿色球衣的球员谁离足球更近?"],"image_path":["11.png"],"language":"cn"}
12+
{"id":"12","prompt":["分析一下这个图片"],"image_path":["12.png"],"language":"cn"}
13+
{"id":"13","prompt":["What are the consequences of the easy decisions shown in this image?"],"image_path":["13.png"],"language":"en"}
14+
{"id":"14","prompt":["Based on this image, please predict what will happen next?"],"image_path":["14.png"],"language":"en"}
15+
{"id":"15","prompt":["左边给定的是纸盒的外表面,下面哪一项不能由它折叠而成?"],"image_path":["15.png"],"language":"cn"}
16+
{"id":"16","prompt":["用python实现这个流程图"],"image_path":["16.png"],"language":"cn"}
17+
{"id":"17","prompt":["图中解题过程有误,请你给我一个简洁的解答过程以及答案"],"image_path":["17.png"],"language":"cn"}
18+
{"id":"18","prompt":["简单解释一下图中糕点的烘烤过程"],"image_path":["18.png"],"language":"cn"}
19+
{"id":"19","prompt":["给图中的商品生成一段广告语"],"image_path":["19.png"],"language":"cn"}
20+
{"id":"20","prompt":["Can you be my tour guide and give me a brief introduction to this city and its attractions?"],"image_path":["20.png"],"language":"en"}

st_engine/utils/tools.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,12 @@ def load_data(
134134
prompts.append((json_obj["id"], prompt))
135135
else:
136136
logger.warning(f"Invalid prompt format: {line}")
137+
137138
except json.JSONDecodeError:
138139
logger.error(f"Error parsing line: {line}")
140+
139141
except Exception as e:
140142
logger.error(f"Error loading prompts: {str(e)}")
141-
142143
return prompts
143144

144145

@@ -208,7 +209,8 @@ def encode_image(image_path):
208209
Returns:
209210
str: The base64 encoded image string.
210211
"""
211-
with open(image_path, "rb") as image_file:
212+
image_full_path = os.path.join(BASE_DIR, "data", "pic", image_path)
213+
with open(image_full_path, "rb") as image_file:
212214
return base64.b64encode(image_file.read()).decode("utf-8")
213215

214216

0 commit comments

Comments
 (0)