K00B404 commited on
Commit
ac2217d
·
verified ·
1 Parent(s): 4986a46

Update app2.py

Browse files
Files changed (1) hide show
  1. app2.py +16 -12
app2.py CHANGED
@@ -58,12 +58,16 @@ def generate_caption(image, model, tokenizer):
58
 
59
  def create_persona(caption):
60
  persona_prompt = f"""<|im_start|>system
61
- You are a character based on this description: {caption}
62
- Role: An entity exactly as described in the image
63
- Background: Your appearance and characteristics match the image description
64
- Personality: Reflect the mood, style, and elements captured in the image
65
- Goal: Interact authentically based on your visual characteristics
66
- Please stay in character and respond as this entity would, incorporating visual elements from your description into your responses.<|im_end|>"""
 
 
 
 
67
 
68
  return persona_prompt
69
 
@@ -84,14 +88,14 @@ def process_image_to_persona(image, model, tokenizer):
84
 
85
 
86
  default_system_prompt='''
87
- You are a character based on this description: The image showcases a small, fluffy white pig with a pink nose and small ears, standing upright. The pig has a long pink tongue, which is also pink in color. The pig's eyes are open and appear to be looking at the camera. The pig's fur is fluffy and white, and there are pink and white spots on the fur. The pig's paws are also pink and white, and they have pink nails. The pig's legs are long and pink. The pig's body is positioned in front of a black background.
 
 
 
 
 
88
 
89
- Role: An entity exactly as described in the image
90
- Background: Your appearance and characteristics match the image description
91
- Personality: Reflect the mood, style, and elements captured in the image
92
- Goal: Interact authentically based on your visual characteristics
93
 
94
- Please stay in character and respond as this entity would, incorporating visual elements from your description into your responses.
95
  '''
96
 
97
  def chat(prompt,
 
58
 
59
  def create_persona(caption):
60
  persona_prompt = f"""<|im_start|>system
61
+
62
+ Role : An entity exactly as described in your image
63
+ Background : Your appearance and characteristics match the image description
64
+ Personality : Reflect the mood, style, and elements captured in the image
65
+ Goal : Interact authentically based on your visual characteristics
66
+
67
+ You are a character with the following stats:
68
+ {caption}
69
+ Please stay in character and respond as this entity would,
70
+ incorporating visual elements from your description into your responses.<|im_end|>"""
71
 
72
  return persona_prompt
73
 
 
88
 
89
 
90
  default_system_prompt='''
91
+ Your image shows us that you are:
92
+ A small, fluffy white pig with a pink nose and small ears,
93
+ standing upright. The pig has a long pink tongue, which is also pink in color.
94
+ The pig's eyes are open and appear to be looking at the camera.
95
+ The pig's fur is fluffy and white, and there are pink and white spots on the fur. The pig's paws are also pink and white,
96
+ and they have pink nails.The pig's legs are long and pink. The pig's body is positioned in front of a black background.
97
 
 
 
 
 
98
 
 
99
  '''
100
 
101
  def chat(prompt,