Spaces:
Runtime error
Runtime error
Commit
·
6eae4fb
1
Parent(s):
94e2e28
Update app.py
Browse files
app.py
CHANGED
@@ -6,6 +6,9 @@ import os, gc
|
|
6 |
import gradio as gr
|
7 |
from transformers import VitsModel, AutoTokenizer, pipeline
|
8 |
import torch
|
|
|
|
|
|
|
9 |
|
10 |
model = VitsModel.from_pretrained("facebook/mms-tts-ind")
|
11 |
tokenizer = AutoTokenizer.from_pretrained("facebook/mms-tts-ind")
|
@@ -26,7 +29,7 @@ def pred(product_name, orientation):
|
|
26 |
orientation = "square"
|
27 |
height = 1080
|
28 |
width = 1080
|
29 |
-
folder_name, sentences = pexels.generate_videos(product_name, pexels_api_key, orientation, height, width, model, tokenizer)
|
30 |
gc.collect()
|
31 |
utils.combine_videos(folder_name)
|
32 |
|
|
|
6 |
import gradio as gr
|
7 |
from transformers import VitsModel, AutoTokenizer, pipeline
|
8 |
import torch
|
9 |
+
from transformers import pipeline
|
10 |
+
|
11 |
+
text_cls = pipeline("text-classification", "ivanlau/language-detection-fine-tuned-on-xlm-roberta-base")
|
12 |
|
13 |
model = VitsModel.from_pretrained("facebook/mms-tts-ind")
|
14 |
tokenizer = AutoTokenizer.from_pretrained("facebook/mms-tts-ind")
|
|
|
29 |
orientation = "square"
|
30 |
height = 1080
|
31 |
width = 1080
|
32 |
+
folder_name, sentences = pexels.generate_videos(product_name, pexels_api_key, orientation, height, width, model, tokenizer, model2, tokenizer2, text_cls)
|
33 |
gc.collect()
|
34 |
utils.combine_videos(folder_name)
|
35 |
|