codeteach commited on
Commit
002b4f1
1 Parent(s): 5dd28de

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -53,6 +53,9 @@ def split_text(text, max_tokens=1024):
53
 
54
  # Helper function to summarize text
55
  def summarize_text(text, model):
 
 
 
56
  chunks = split_text(text)
57
  summaries = []
58
  for chunk in chunks:
@@ -137,3 +140,4 @@ iface.launch()
137
 
138
 
139
 
 
 
53
 
54
  # Helper function to summarize text
55
  def summarize_text(text, model):
56
+ if len(text) < 200: # Adjust the threshold as needed
57
+ print("Input text is too short for summarization. Please provide longer text.")
58
+ return ""
59
  chunks = split_text(text)
60
  summaries = []
61
  for chunk in chunks:
 
140
 
141
 
142
 
143
+