jonathanjordan21 commited on
Commit
113c0ca
·
1 Parent(s): c9fffcd

Update components/pexels.py

Browse files
Files changed (1) hide show
  1. components/pexels.py +5 -2
components/pexels.py CHANGED
@@ -2,7 +2,9 @@ import requests
2
  import shutil,os,re
3
  import datetime
4
  import torch
5
- import soundfile as sf
 
 
6
 
7
  # Searching for the videos
8
  def search_pexels(keyword, api_key, orientation='potrait', size='medium', endpoint='videos', num_pages=50, pages=4):
@@ -73,8 +75,9 @@ def generate_videos(text, api_key, orientation, height, width, model, tokenizer,
73
  links = []
74
  try :
75
  # Split the paragraph by sentences
76
- sentences = list(filter(None,[x.strip() for x in re.split(r'[^A-Za-z0-9 -]', text)]))
77
  # print(len(sentences))
 
78
 
79
  # Create directory with the name
80
  di = str(datetime.datetime.now())
 
2
  import shutil,os,re
3
  import datetime
4
  import torch
5
+ import soundfile as SF
6
+
7
+ from custom_llm import custom_chain
8
 
9
  # Searching for the videos
10
  def search_pexels(keyword, api_key, orientation='potrait', size='medium', endpoint='videos', num_pages=50, pages=4):
 
75
  links = []
76
  try :
77
  # Split the paragraph by sentences
78
+ # sentences = list(filter(None,[x.strip() for x in re.split(r'[^A-Za-z0-9 -]', text)]))
79
  # print(len(sentences))
80
+ sentences = list(filter(None,[x.strip() for x in re.split(r'[^A-Za-z -]', custom_chain().invoke(p))]))
81
 
82
  # Create directory with the name
83
  di = str(datetime.datetime.now())