Spaces:
Runtime error
Runtime error
jonathanjordan21
commited on
Commit
•
b080a94
1
Parent(s):
f9c65e6
Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline, AutoMode
|
|
4 |
|
5 |
from components import caption_chain, tag_chain
|
6 |
from components import pexels, utils
|
7 |
-
import os
|
8 |
import gradio as gr
|
9 |
|
10 |
model = AutoModelForSeq2SeqLM.from_pretrained("declare-lab/flan-alpaca-gpt4-xl")
|
@@ -26,6 +26,7 @@ pexels_api_key = os.getenv('pexels_api_key')
|
|
26 |
|
27 |
def pred(product_name, orientation):
|
28 |
folder_name, sentences = pexels.generate_videos(product_name, pexels_api_key, orientation, llm_chain, sum_llm_chain)
|
|
|
29 |
utils.combine_videos(folder_name)
|
30 |
return ["\n".join(sentences), os.path.join(folder_name, "Final_Ad_Video.mp4")]
|
31 |
#{'video':os.path.join(folder_name, "Final_Ad_Video.mp4"),
|
|
|
4 |
|
5 |
from components import caption_chain, tag_chain
|
6 |
from components import pexels, utils
|
7 |
+
import os, gc
|
8 |
import gradio as gr
|
9 |
|
10 |
model = AutoModelForSeq2SeqLM.from_pretrained("declare-lab/flan-alpaca-gpt4-xl")
|
|
|
26 |
|
27 |
def pred(product_name, orientation):
|
28 |
folder_name, sentences = pexels.generate_videos(product_name, pexels_api_key, orientation, llm_chain, sum_llm_chain)
|
29 |
+
gc.collect()
|
30 |
utils.combine_videos(folder_name)
|
31 |
return ["\n".join(sentences), os.path.join(folder_name, "Final_Ad_Video.mp4")]
|
32 |
#{'video':os.path.join(folder_name, "Final_Ad_Video.mp4"),
|