fffiloni commited on
Commit
ef7492c
1 Parent(s): b7b7441

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -35,15 +35,15 @@ def get_caption(image_in):
35
  print("Unable to locate valid description.")
36
 
37
  # Find the last occurrence of "."
38
- #last_period_index = full_sentence.rfind('.')
39
 
40
  # Truncate the string up to the last period
41
- #truncated_caption = full_sentence[:last_period_index + 1]
42
 
43
  # print(truncated_caption)
44
- #print(f"\n—\nIMAGE CAPTION: {truncated_caption}")
45
 
46
- return description
47
 
48
  def get_magnet(prompt):
49
  amended_prompt = f"High quality sound effects. {prompt}"
 
35
  print("Unable to locate valid description.")
36
 
37
  # Find the last occurrence of "."
38
+ last_period_index = description.rfind('.')
39
 
40
  # Truncate the string up to the last period
41
+ truncated_caption = description[:last_period_index + 1]
42
 
43
  # print(truncated_caption)
44
+ print(f"\n—\nIMAGE CAPTION: {truncated_caption}")
45
 
46
+ return truncated_caption
47
 
48
  def get_magnet(prompt):
49
  amended_prompt = f"High quality sound effects. {prompt}"