Spaces:
Sleeping
Sleeping
Keep trying fix String index has to be integer
Browse files
app.py
CHANGED
|
@@ -30,11 +30,14 @@ def brief_text_in_n_sentences(text:str, n:int)-> str: #it's import to specify th
|
|
| 30 |
if not text.strip():
|
| 31 |
return "No text provided to summarize."
|
| 32 |
|
| 33 |
-
prompt = (
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
)
|
| 37 |
-
|
|
|
|
|
|
|
|
|
|
| 38 |
try:
|
| 39 |
# response = model(prompt)
|
| 40 |
# return response
|
|
|
|
| 30 |
if not text.strip():
|
| 31 |
return "No text provided to summarize."
|
| 32 |
|
| 33 |
+
# prompt = (
|
| 34 |
+
# f"Please summarize the following text in exactly {n} sentence{'s' if n > 1 else ''}. Each sentence is a bullet point. The text is:\n\n{text}\n\n"
|
| 35 |
+
# "Summary:"
|
| 36 |
+
# )
|
| 37 |
+
prompt = [
|
| 38 |
+
{'role': 'user', 'content': [{'type': 'text', 'text': f'Please summarize the following text in exactly {n} sentence{"s" if n > 1 else ""}. Each sentence is a bullet point. The text is:\n\n{text}\n\n'}]}
|
| 39 |
+
]
|
| 40 |
+
|
| 41 |
try:
|
| 42 |
# response = model(prompt)
|
| 43 |
# return response
|