methodya commited on
Commit
771297a
·
verified ·
1 Parent(s): a78b0c0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -2,6 +2,7 @@ import streamlit as st
2
  from huggingface_hub import hf_hub_download
3
  from llama_cpp import Llama
4
  import os
 
5
 
6
  # تحميل النموذج من Hugging Face
7
  model_path = hf_hub_download(
@@ -42,6 +43,11 @@ st.markdown("أداة لتلخيص النصوص الفلسفية باللغة ا
42
 
43
  # إنشاء واجهة الإدخال والإخراج
44
  text_input = st.text_area("النص الفلسفي", height=200)
 
45
  if st.button("تلخيص"):
46
- summary = summarize(text_input)
 
 
 
 
47
  st.text_area("الملخص", value=summary, height=150, disabled=True)
 
2
  from huggingface_hub import hf_hub_download
3
  from llama_cpp import Llama
4
  import os
5
+ import time
6
 
7
  # تحميل النموذج من Hugging Face
8
  model_path = hf_hub_download(
 
43
 
44
  # إنشاء واجهة الإدخال والإخراج
45
  text_input = st.text_area("النص الفلسفي", height=200)
46
+
47
  if st.button("تلخيص"):
48
+ with st.spinner('Processing...'):
49
+ # محاكاة لعملية المعالجة التي تستغرق وقتًا طويلاً
50
+ time.sleep(3) # استبدال هذا بـ عملية النموذج
51
+ summary = summarize(text_input)
52
+ st.success('تم التلخيص بنجاح!')
53
  st.text_area("الملخص", value=summary, height=150, disabled=True)