alfredplpl commited on
Commit
c23df4e
1 Parent(s): 22e8896

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -30,8 +30,9 @@ upsampler = pipeline(
30
  generation_args = {
31
  "max_new_tokens": 300,
32
  "return_full_text": False,
33
- "temperature": 0.0,
34
- "do_sample": False,
 
35
  }
36
 
37
  MAX_SEED = np.iinfo(np.int32).max
@@ -40,13 +41,14 @@ MAX_IMAGE_SIZE = 1344
40
  @spaces.GPU
41
  def infer(prompt, negative_prompt, seed, randomize_seed, width, height, guidance_scale, num_inference_steps, progress=gr.Progress(track_tqdm=True)):
42
  messages = [
43
- {"role": "user", "content": "Can you provide ways to eat combinations of bananas and dragonfruits?"},
44
- {"role": "assistant", "content": "Sure! Here are some ways to eat bananas and dragonfruits together: 1. Banana and dragonfruit smoothie: Blend bananas and dragonfruits together with some milk and honey. 2. Banana and dragonfruit salad: Mix sliced bananas and dragonfruits together with some lemon juice and honey."},
45
- {"role": "user", "content": "What about solving an 2x + 3 = 7 equation?"},
46
  ]
47
  output = upsampler(messages, **generation_args)
48
  upsampled_prompt=output[0]['generated_text']
49
-
 
50
  if randomize_seed:
51
  seed = random.randint(0, MAX_SEED)
52
 
 
30
  generation_args = {
31
  "max_new_tokens": 300,
32
  "return_full_text": False,
33
+ "temperature": 0.7,
34
+ "do_sample": True,
35
+ "top_p": 0.95
36
  }
37
 
38
  MAX_SEED = np.iinfo(np.int32).max
 
41
  @spaces.GPU
42
  def infer(prompt, negative_prompt, seed, randomize_seed, width, height, guidance_scale, num_inference_steps, progress=gr.Progress(track_tqdm=True)):
43
  messages = [
44
+ {"role": "user", "content": "クールなアニメ風の女の子"},
45
+ {"role": "assistant", "content": "An anime style illustration of a cool-looking teenage girl with an edgy, confident expression. She has piercing eyes, a slight smirk, and colorful hair that flows in the wind. She wears a trendy punk-inspired outfit with a leather jacket, ripped jeans, and combat boots. The background has an urban nighttime feel with city lights and graffiti to match her rebellious vibe. The colors are vibrant with high contrast to give an impactful look. The overall style captures her undeniable coolness and fearless attitude."},
46
+ {"role": "user", "content": prompt },
47
  ]
48
  output = upsampler(messages, **generation_args)
49
  upsampled_prompt=output[0]['generated_text']
50
+ print(upsampled_prompt)
51
+
52
  if randomize_seed:
53
  seed = random.randint(0, MAX_SEED)
54