Mohzen321 commited on
Commit
68c151b
·
verified ·
1 Parent(s): 4e37c20

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -82,10 +82,10 @@ if uploaded_file is not None:
82
  unknown_items.append(batch[j])
83
 
84
  # تحديث المؤشر الحالي
85
- current_index = i + batch_size
86
 
87
  # تحديث شريط التقدم
88
- progress = (current_index) / total_items
89
  progress_bar.progress(progress)
90
 
91
  # تحديث النتائج في الوقت الحقيقي
@@ -141,10 +141,10 @@ if uploaded_file is not None:
141
  full_page_types.append(page_type)
142
 
143
  # تحديث المؤشر الحالي
144
- current_index = i + batch_size
145
 
146
  # تحديث شريط التقدم
147
- progress = (current_index) / total_items
148
  progress_bar.progress(progress)
149
 
150
  # تحديث النتائج في الوقت الحقيقي
 
82
  unknown_items.append(batch[j])
83
 
84
  # تحديث المؤشر الحالي
85
+ current_index = min(i + batch_size, total_items) # تأكد من عدم تجاوز المؤشر للعدد الإجمالي
86
 
87
  # تحديث شريط التقدم
88
+ progress = min((current_index) / total_items, 1.0) # تأكد من أن قيمة التقدم لا تتجاوز 1.0
89
  progress_bar.progress(progress)
90
 
91
  # تحديث النتائج في الوقت الحقيقي
 
141
  full_page_types.append(page_type)
142
 
143
  # تحديث المؤشر الحالي
144
+ current_index = min(i + batch_size, total_items) # تأكد من عدم تجاوز المؤشر للعدد الإجمالي
145
 
146
  # تحديث شريط التقدم
147
+ progress = min((current_index) / total_items, 1.0) # تأكد من أن قيمة التقدم لا تتجاوز 1.0
148
  progress_bar.progress(progress)
149
 
150
  # تحديث النتائج في الوقت الحقيقي