Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -2,8 +2,8 @@ import os
|
|
2 |
import tempfile
|
3 |
import base64
|
4 |
from flask import Flask, request, jsonify, send_file, send_from_directory
|
5 |
-
|
6 |
-
from google.
|
7 |
from gtts import gTTS, lang
|
8 |
from kokoro import KPipeline
|
9 |
from werkzeug.utils import secure_filename
|
@@ -17,8 +17,7 @@ GEMINI_API_KEY = os.getenv("GEMINI_API_KEY")
|
|
17 |
if not GEMINI_API_KEY:
|
18 |
raise ValueError("GEMINI_API_KEY environment variable not set")
|
19 |
|
20 |
-
|
21 |
-
client = genai.Client(api_key=GEMINI_API_KEY)
|
22 |
|
23 |
# Language configurations
|
24 |
KOKORO_LANGUAGES = {
|
|
|
2 |
import tempfile
|
3 |
import base64
|
4 |
from flask import Flask, request, jsonify, send_file, send_from_directory
|
5 |
+
import google.generativeai as genai
|
6 |
+
from google.generativeai.types import Content, Part
|
7 |
from gtts import gTTS, lang
|
8 |
from kokoro import KPipeline
|
9 |
from werkzeug.utils import secure_filename
|
|
|
17 |
if not GEMINI_API_KEY:
|
18 |
raise ValueError("GEMINI_API_KEY environment variable not set")
|
19 |
|
20 |
+
genai.configure(api_key=GEMINI_API_KEY)
|
|
|
21 |
|
22 |
# Language configurations
|
23 |
KOKORO_LANGUAGES = {
|