Spaces:
Running
Running
add upgrade model version
Browse files- utils/utils.py +2 -2
utils/utils.py
CHANGED
@@ -10,7 +10,7 @@ import re
|
|
10 |
from dotenv import load_dotenv
|
11 |
load_dotenv() # Load environment variables from .env file
|
12 |
|
13 |
-
genai.configure(os.getenv("GEMINI_API_KEY"))
|
14 |
|
15 |
|
16 |
def unzip_office_file(pptx_file: io.BytesIO):
|
@@ -143,7 +143,7 @@ def translate_text(text_dict, source_lang='English', target_lang="Vietnamese", m
|
|
143 |
retry_count = 0
|
144 |
while retry_count < max_retries:
|
145 |
try:
|
146 |
-
model = genai.GenerativeModel(os.getenv("MODEL_VERSION"))
|
147 |
full_prompt = f"{system_prompt.strip()}\n\n{user_prompt.strip()}"
|
148 |
|
149 |
response = model.generate_content(
|
|
|
10 |
from dotenv import load_dotenv
|
11 |
load_dotenv() # Load environment variables from .env file
|
12 |
|
13 |
+
genai.configure(api_key=os.getenv("GEMINI_API_KEY"))
|
14 |
|
15 |
|
16 |
def unzip_office_file(pptx_file: io.BytesIO):
|
|
|
143 |
retry_count = 0
|
144 |
while retry_count < max_retries:
|
145 |
try:
|
146 |
+
model = genai.GenerativeModel(os.getenv("MODEL_VERSION")) # Use the appropriate model version
|
147 |
full_prompt = f"{system_prompt.strip()}\n\n{user_prompt.strip()}"
|
148 |
|
149 |
response = model.generate_content(
|