kouki321 commited on
Commit
8d43e13
Β·
verified Β·
1 Parent(s): 9581c4a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -183,14 +183,14 @@ if uploaded_file:
183
  f.write(uploaded_file.getvalue())
184
  t_end1 = time()
185
  log.append(f"πŸ“‚ File Upload & Save Time: {t_end1 - t_start1:.2f} s")
186
- print(f"πŸ“‚ File Upload & Save Time: {t_end1 - t_start1:.2f} s")
187
 
188
  # PART 2: Document and Cache Load
189
  t_start2 = time()
190
  cache, doc_text,doc_text_count, model, tokenizer = load_document_and_cache(temp_file_path)
191
  t_end2 = time()
192
  log.append(f"πŸ“„ Document & Cache Load Time: {t_end2 - t_start2:.2f} s")
193
- print(f"πŸ“„ Document & Cache Load Time: {t_end2 - t_start2:.2f} s")
194
 
195
  # PART 3: Document Preview Display
196
  t_start3 = time()
@@ -199,13 +199,13 @@ if uploaded_file:
199
  st.text(preview)
200
  t_end3 = time()
201
  log.append(f"πŸ‘€ Document Preview Display Time: {t_end3 - t_start3:.2f} s")
202
- print(f"πŸ‘€ Document Preview Display Time: {t_end3 - t_start3:.2f} s")
203
  t_start4 = time()
204
  # PART 4: Show Basic Info
205
  s_cache=calculate_cache_size(cache)
206
  t_end4 = time()
207
  log.append(f"πŸ‘€ doc_size_kb Preview Display Time: {t_end4 - t_start4:.2f} s")
208
- print(f"πŸ‘€ doc_size_kb Preview Display Time: {t_end4 - t_start4:.2f} s||||||| size of the cache : {s_cache} MB")
209
  #st.info(
210
  # f"Document Chars: {len(doc_text)} | Size: {doc_size_kb:.2f} KB | "
211
  # f"Cache Size: {cache_size if cache_size == 'N/A' else f'{cache_size:.2f} KB'}"
@@ -258,10 +258,10 @@ if uploaded_file:
258
  st.write(response)
259
  print(f"***************************************************************************************")
260
  # Final Info Display
261
- st.info(
262
  # f"Document Chars: {len(doc_text)} | Size: {doc_size_kb:.2f} KB | "
263
- f"Cache Clone Time: {log[-3].split(': ')[1]} | Generation Time: {last_generation_time:.2f} s"
264
- )
265
 
266
  # =========================
267
  # Show Log
 
183
  f.write(uploaded_file.getvalue())
184
  t_end1 = time()
185
  log.append(f"πŸ“‚ File Upload & Save Time: {t_end1 - t_start1:.2f} s")
186
+ # print(f"πŸ“‚ File Upload & Save Time: {t_end1 - t_start1:.2f} s")
187
 
188
  # PART 2: Document and Cache Load
189
  t_start2 = time()
190
  cache, doc_text,doc_text_count, model, tokenizer = load_document_and_cache(temp_file_path)
191
  t_end2 = time()
192
  log.append(f"πŸ“„ Document & Cache Load Time: {t_end2 - t_start2:.2f} s")
193
+ # print(f"πŸ“„ Document & Cache Load Time: {t_end2 - t_start2:.2f} s")
194
 
195
  # PART 3: Document Preview Display
196
  t_start3 = time()
 
199
  st.text(preview)
200
  t_end3 = time()
201
  log.append(f"πŸ‘€ Document Preview Display Time: {t_end3 - t_start3:.2f} s")
202
+ # print(f"πŸ‘€ Document Preview Display Time: {t_end3 - t_start3:.2f} s")
203
  t_start4 = time()
204
  # PART 4: Show Basic Info
205
  s_cache=calculate_cache_size(cache)
206
  t_end4 = time()
207
  log.append(f"πŸ‘€ doc_size_kb Preview Display Time: {t_end4 - t_start4:.2f} s")
208
+ # print(f"πŸ‘€ doc_size_kb Preview Display Time: {t_end4 - t_start4:.2f} s||||||| size of the cache : {s_cache} MB")
209
  #st.info(
210
  # f"Document Chars: {len(doc_text)} | Size: {doc_size_kb:.2f} KB | "
211
  # f"Cache Size: {cache_size if cache_size == 'N/A' else f'{cache_size:.2f} KB'}"
 
258
  st.write(response)
259
  print(f"***************************************************************************************")
260
  # Final Info Display
261
+ # st.info(
262
  # f"Document Chars: {len(doc_text)} | Size: {doc_size_kb:.2f} KB | "
263
+ # f"Cache Clone Time: {log[-3].split(': ')[1]} | Generation Time: {last_generation_time:.2f} s"
264
+ # )
265
 
266
  # =========================
267
  # Show Log