Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,12 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
import requests
|
|
|
4 |
|
5 |
# ์ด๋ฏธ์ง ์ธ์ ํ์ดํ๋ผ์ธ ๋ก๋
|
6 |
image_model = pipeline("image-classification", model="google/vit-base-patch16-224")
|
7 |
|
8 |
-
# API ํ ํฐ ๋ก๋
|
9 |
hugging_face_auth_token = os.getenv("HUGGING_FACE_AUTH_TOKEN")
|
10 |
|
11 |
def get_audiogen(prompt):
|
@@ -17,6 +18,7 @@ def get_audiogen(prompt):
|
|
17 |
json={"inputs": prompt, "parameters": {"length": 10}, "options": {"use_cache": False}}
|
18 |
)
|
19 |
result = response.json()
|
|
|
20 |
return result
|
21 |
|
22 |
def classify_and_generate_audio(uploaded_image):
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
import requests
|
4 |
+
import os # os ๋ชจ๋์ ์ํฌํธํฉ๋๋ค.
|
5 |
|
6 |
# ์ด๋ฏธ์ง ์ธ์ ํ์ดํ๋ผ์ธ ๋ก๋
|
7 |
image_model = pipeline("image-classification", model="google/vit-base-patch16-224")
|
8 |
|
9 |
+
# ํ๊ฒฝ ๋ณ์์์ Hugging Face API ํ ํฐ ๋ก๋
|
10 |
hugging_face_auth_token = os.getenv("HUGGING_FACE_AUTH_TOKEN")
|
11 |
|
12 |
def get_audiogen(prompt):
|
|
|
18 |
json={"inputs": prompt, "parameters": {"length": 10}, "options": {"use_cache": False}}
|
19 |
)
|
20 |
result = response.json()
|
21 |
+
# ์ฌ๊ธฐ์์ result ์ฒ๋ฆฌ ๋ก์ง์ ๊ตฌํํฉ๋๋ค.
|
22 |
return result
|
23 |
|
24 |
def classify_and_generate_audio(uploaded_image):
|