ccxccc commited on
Commit
f2e799c
·
verified ·
1 Parent(s): c689838

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -2
app.py CHANGED
@@ -13,7 +13,12 @@ def check_installation(package):
13
  return True
14
 
15
  def install_tensorflow():
16
- subprocess.check_call(['pip', 'install', 'tensorflow==2.0'])
 
 
 
 
 
17
 
18
  def summarize(result):
19
  summarizer = pipeline('summarization')
@@ -55,7 +60,11 @@ def get_transcript(video_link):
55
  def main():
56
  if not check_installation("tensorflow"):
57
  st.write("TensorFlow 2.0 is not installed. Installing...")
58
- install_tensorflow()
 
 
 
 
59
 
60
  import tensorflow as tf
61
 
 
13
  return True
14
 
15
  def install_tensorflow():
16
+ try:
17
+ subprocess.check_call(['pip', 'install', 'tensorflow==2.0'])
18
+ return True
19
+ except subprocess.CalledProcessError as e:
20
+ st.error(f"TensorFlow installation failed with error: {e}")
21
+ return False
22
 
23
  def summarize(result):
24
  summarizer = pipeline('summarization')
 
60
  def main():
61
  if not check_installation("tensorflow"):
62
  st.write("TensorFlow 2.0 is not installed. Installing...")
63
+ if install_tensorflow():
64
+ st.success("TensorFlow 2.0 has been successfully installed.")
65
+ else:
66
+ st.error("Failed to install TensorFlow 2.0. Please install it manually and retry.")
67
+ return
68
 
69
  import tensorflow as tf
70