Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,6 @@ import warnings
|
|
11 |
warnings.filterwarnings("ignore")
|
12 |
|
13 |
# Image-to-text
|
14 |
-
@spaces.GPU
|
15 |
def img2txt(url):
|
16 |
print("Initializing captioning model...")
|
17 |
captioning_model = pipeline("image-to-text", model="Salesforce/blip-image-captioning-base")
|
@@ -23,7 +22,6 @@ def img2txt(url):
|
|
23 |
return text
|
24 |
|
25 |
# Text-to-story
|
26 |
-
@spaces.GPU
|
27 |
def txt2story(img_text, top_k, top_p, temperature):
|
28 |
|
29 |
headers = {"Authorization": f"Bearer {os.environ['TOGETHER_API_KEY']}"}
|
@@ -47,7 +45,6 @@ def txt2story(img_text, top_k, top_p, temperature):
|
|
47 |
|
48 |
|
49 |
# Text-to-speech
|
50 |
-
@spaces.GPU
|
51 |
def txt2speech(text):
|
52 |
print("Initializing text-to-speech conversion...")
|
53 |
API_URL = "https://api-inference.huggingface.co/models/espnet/kan-bayashi_ljspeech_vits"
|
|
|
11 |
warnings.filterwarnings("ignore")
|
12 |
|
13 |
# Image-to-text
|
|
|
14 |
def img2txt(url):
|
15 |
print("Initializing captioning model...")
|
16 |
captioning_model = pipeline("image-to-text", model="Salesforce/blip-image-captioning-base")
|
|
|
22 |
return text
|
23 |
|
24 |
# Text-to-story
|
|
|
25 |
def txt2story(img_text, top_k, top_p, temperature):
|
26 |
|
27 |
headers = {"Authorization": f"Bearer {os.environ['TOGETHER_API_KEY']}"}
|
|
|
45 |
|
46 |
|
47 |
# Text-to-speech
|
|
|
48 |
def txt2speech(text):
|
49 |
print("Initializing text-to-speech conversion...")
|
50 |
API_URL = "https://api-inference.huggingface.co/models/espnet/kan-bayashi_ljspeech_vits"
|