AkashKhamkar commited on
Commit
99d49d1
1 Parent(s): 7151a6c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -18,8 +18,8 @@ from PIL import ImageDraw
18
  from PIL import ImageFont
19
 
20
 
21
- if not os.path.exists('C:/Users/akash/OneDrive/Documents/New folder/virtual_envs/streamlit_app/transcripts/'):
22
- os.mkdir('C:/Users/akash/OneDrive/Documents/New folder/virtual_envs/streamlit_app/transcripts/')
23
  device = 'cuda' if cuda.is_available() else 'cpu'
24
 
25
  def clean_text(link,start,end):
@@ -256,7 +256,7 @@ def card_creator(path, text, y_value):
256
  return lines
257
 
258
 
259
- font_path = 'streamlit_app/static/Montserrat-Regular.ttf'
260
  font = ImageFont.truetype(font=font_path, size=22)
261
  lines = text_wrap(text, font, img.size[0] - 44)
262
  line_height = font.getsize('hg')[1]
@@ -305,12 +305,12 @@ def main():
305
  if len(text) > 380 :
306
  st.error('Summary is too long !')
307
  else:
308
- card_creator('C:/Users/akash/OneDrive/Pictures/iteration5_empty.png',text,335)
309
  else :
310
  if len(text) > 430 :
311
  st.error('Summary is too long !')
312
  else :
313
- card_creator('C:/Users/akash/OneDrive/Pictures/X-93.png',text,285)
314
 
315
  with open("card.png", "rb") as file:
316
  btn = st.download_button(
 
18
  from PIL import ImageFont
19
 
20
 
21
+ if not os.path.exists('./transcripts'):
22
+ os.mkdir('./transcripts')
23
  device = 'cuda' if cuda.is_available() else 'cpu'
24
 
25
  def clean_text(link,start,end):
 
256
  return lines
257
 
258
 
259
+ font_path = 'Montserrat-Regular.ttf'
260
  font = ImageFont.truetype(font=font_path, size=22)
261
  lines = text_wrap(text, font, img.size[0] - 44)
262
  line_height = font.getsize('hg')[1]
 
305
  if len(text) > 380 :
306
  st.error('Summary is too long !')
307
  else:
308
+ card_creator('iteration5_empty.png',text,335)
309
  else :
310
  if len(text) > 430 :
311
  st.error('Summary is too long !')
312
  else :
313
+ card_creator('X-93.png',text,285)
314
 
315
  with open("card.png", "rb") as file:
316
  btn = st.download_button(