Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,14 +6,9 @@ from huggingface_hub import hf_hub_download
|
|
| 6 |
from piper import PiperVoice
|
| 7 |
from transformers import pipeline
|
| 8 |
|
| 9 |
-
# Load the NSFW classifier model
|
| 10 |
-
nsfw_detector = pipeline("text-classification", model="michellejieli/NSFW_text_classifier")
|
| 11 |
|
| 12 |
def synthesize_speech(text):
|
| 13 |
-
|
| 14 |
-
nsfw_result = nsfw_detector(text)
|
| 15 |
-
if nsfw_result[0]['label'] == 'NSFW':
|
| 16 |
-
return "NSFW content detected. Cannot process.", None
|
| 17 |
|
| 18 |
model_path = hf_hub_download(repo_id="gyroing/Persian-Piper-Model-gyro", filename="fa_IR-gyro-meduim.onnx")
|
| 19 |
config_path = hf_hub_download(repo_id="gyroing/Persian-Piper-Model-gyro/", filename="fa_IR-gyro-meduim.onnx.json")
|
|
|
|
| 6 |
from piper import PiperVoice
|
| 7 |
from transformers import pipeline
|
| 8 |
|
|
|
|
|
|
|
| 9 |
|
| 10 |
def synthesize_speech(text):
|
| 11 |
+
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
model_path = hf_hub_download(repo_id="gyroing/Persian-Piper-Model-gyro", filename="fa_IR-gyro-meduim.onnx")
|
| 14 |
config_path = hf_hub_download(repo_id="gyroing/Persian-Piper-Model-gyro/", filename="fa_IR-gyro-meduim.onnx.json")
|