Spaces:
Running
on
Zero
Running
on
Zero
regex expression changed
Browse files
app.py
CHANGED
@@ -35,7 +35,7 @@ def get_caption(image_in):
|
|
35 |
#print(full_sentence)
|
36 |
|
37 |
# Find the pattern matching the expected format ("Describe this image in detail:" followed by optional space and then the rest)...
|
38 |
-
pattern = r'
|
39 |
# Apply the regex pattern to extract the description text.
|
40 |
match = re.search(pattern, full_sentence)
|
41 |
if match:
|
|
|
35 |
#print(full_sentence)
|
36 |
|
37 |
# Find the pattern matching the expected format ("Describe this image in detail:" followed by optional space and then the rest)...
|
38 |
+
pattern = r'^Describe this image in detail:\s*(.*)$'
|
39 |
# Apply the regex pattern to extract the description text.
|
40 |
match = re.search(pattern, full_sentence)
|
41 |
if match:
|