sphinxsolution commited on
Commit
eb2fa15
Β·
verified Β·
1 Parent(s): cda056f

updated the examples format

Browse files
Files changed (1) hide show
  1. app.py +15 -15
app.py CHANGED
@@ -10,23 +10,23 @@ class EnhancePrompt(Signature):
10
  # Ensure the correct fields are defined
11
  original_prompt:str = InputField(desc="Short prompt describing the filtered image")
12
  task_goal: str = InputField(desc="What transformation you want, e.g., remove filters")
13
- enhanced_prompt: str = OutputField(desc="More detailed, enhanced prompt suitable for image generation.")
14
 
15
- # Instantiate the enhancer with the proper Signature model
16
- enhancer = Predict(EnhancePrompt)
17
-
18
- # Add few-shot examples to guide DSPy
19
- enhancer.add_example(Example(
20
- original_prompt="girl face with some filter",
21
- task_goal="remove filters and restore natural face",
22
- enhanced_prompt="realistic photo of a girl without makeup, natural skin tone, no smoothing, clear eyes"
23
- ))
 
 
 
24
 
25
- enhancer.add_example(Example(
26
- original_prompt="face with beauty filter",
27
- task_goal="restore original face",
28
- enhanced_prompt="natural face, original skin texture, no filter, raw facial features"
29
- ))
30
 
31
  # πŸ”§ Load ControlNet
32
  controlnet = ControlNetModel.from_pretrained(
 
10
  # Ensure the correct fields are defined
11
  original_prompt:str = InputField(desc="Short prompt describing the filtered image")
12
  task_goal: str = InputField(desc="What transformation you want, e.g., remove filters")
13
+ __output__: str = OutputField(desc="More detailed, enhanced prompt suitable for image generation.")
14
 
15
+ examples = [
16
+ Example(
17
+ original_prompt = "girl face with some filter",
18
+ task_goal = "remove filters and restore natural face",
19
+ __output__="realistic photo of a girl without makeup, natural skin tone, no smoothing, clear eyes."
20
+ ),
21
+ Example(
22
+ original_prompt = "face with beauty filter",
23
+ task_goal = "restore original face",
24
+ __output__="natural face, original skin texture, no filter, raw facial features"
25
+ )
26
+ ]
27
 
28
+ # Instantiate the enhancer with the proper Signature model
29
+ enhancer = Predict(EnhancePrompt,examples=examples)
 
 
 
30
 
31
  # πŸ”§ Load ControlNet
32
  controlnet = ControlNetModel.from_pretrained(