shigeru saito commited on
Commit
13cce5c
·
1 Parent(s): 3d9d048

template.mdから取得するように修正

Browse files
Files changed (2) hide show
  1. app.py +12 -11
  2. template.md +12 -12
app.py CHANGED
@@ -152,18 +152,19 @@ class NajiminoAI:
152
 
153
  def format_recipe(self, lang, title, description, ingredients, instruction, comment_feelings_taste, explanation_to_blind_person, prompt_for_visual_expression_in_en):
154
 
155
- debug_message = f"""
156
- lang: {lang}
157
- title: {title}
158
- description: {description}
159
- ingredients: {ingredients}
160
- instruction: {instruction}
161
- comment_feelings_taste: {comment_feelings_taste}
162
- explanation_to_blind_person: {explanation_to_blind_person}
163
- prompt_for_visual_expression_in_en: {prompt_for_visual_expression_in_en}
164
- """
 
165
 
166
- print(debug_message)
167
 
168
  return debug_message
169
 
 
152
 
153
  def format_recipe(self, lang, title, description, ingredients, instruction, comment_feelings_taste, explanation_to_blind_person, prompt_for_visual_expression_in_en):
154
 
155
+ template = get_filetext(filename = "template.md")
156
+ debug_message = template.format(
157
+ lang=lang,
158
+ title=title,
159
+ description=description,
160
+ ingredients=ingredients,
161
+ instruction=instruction,
162
+ comment_feelings_taste=comment_feelings_taste,
163
+ explanation_to_blind_person=explanation_to_blind_person,
164
+ prompt_for_visual_expression_in_en=prompt_for_visual_expression_in_en
165
+ )
166
 
167
+ print("debug_message: "+debug_message)
168
 
169
  return debug_message
170
 
template.md CHANGED
@@ -1,23 +1,23 @@
1
- ### Title of New Recipe
2
 
3
- Please write your title of new recipe Here.
4
 
5
- ### Your New Recipe Here
6
 
7
- Please write new recipe and brainstorm every point of new recipe to fill the details.
8
 
9
- ### Your Instruction Here
10
 
11
- Please write your instruction to cook the dish of new recipe and brainstorm every point of new recipe to fill the details.
12
 
13
- ### Your Comment and Feelings, taste of new recipe
14
 
15
- Please write review commnet of new recipe here and brainstorm every point of new recipe to fill the details.
16
 
17
- ### Your Explanation to Blind Person
18
 
19
- Please write review commnet of new recipe here to explain to the blind people more concretely in detail. Please brainstorm every point of new recipe to fill the details.
20
 
21
- ### Prompt for Visual Expression
22
 
23
- Please write prompt for visual expression in Generative AI for image the visual of the new recipe and brainstorm every point of new recipe to fill the details.
 
1
+ # レシピ: {title}
2
 
3
+ {description}
4
 
5
+ ## 材料
6
 
7
+ {ingredients}
8
 
9
+ ## 作り方
10
 
11
+ {instruction}
12
 
13
+ ## このレシピの感想と味について
14
 
15
+ {comment_feelings_taste}
16
 
17
+ ## 目の不自由な方への説明
18
 
19
+ {explanation_to_blind_person}
20
 
21
+ ## 画像生成プロンプト
22
 
23
+ {prompt_for_visual_expression_in_en}