zsolnai commited on
Commit ·
9779f59
1
Parent(s): be5c874
Add gradeio app
Browse files- .gitignore +1 -0
- app.py +9 -0
- requirements.txt +1 -0
.gitignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
.env
|
app.py
CHANGED
|
@@ -9,6 +9,15 @@ from huggingface_hub import InferenceClient
|
|
| 9 |
from transformers import pipeline
|
| 10 |
from TTS.api import TTS
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
# --- Device Setup ---
|
| 13 |
device = "cpu"
|
| 14 |
|
|
|
|
| 9 |
from transformers import pipeline
|
| 10 |
from TTS.api import TTS
|
| 11 |
|
| 12 |
+
# Load .env file
|
| 13 |
+
try:
|
| 14 |
+
with open('.env', 'r') as f:
|
| 15 |
+
for line in f:
|
| 16 |
+
line = line.strip()
|
| 17 |
+
if line and not line.startswith('#') and '=' in line:
|
| 18 |
+
key, value = line.split('=', 1)
|
| 19 |
+
os.environ[key.strip()] = value.strip()
|
| 20 |
+
|
| 21 |
# --- Device Setup ---
|
| 22 |
device = "cpu"
|
| 23 |
|
requirements.txt
CHANGED
|
@@ -5,3 +5,4 @@ TTS
|
|
| 5 |
soundfile
|
| 6 |
numpy
|
| 7 |
huggingface-hub
|
|
|
|
|
|
| 5 |
soundfile
|
| 6 |
numpy
|
| 7 |
huggingface-hub
|
| 8 |
+
python-dotenv
|