Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -91,7 +91,7 @@ class TranslatorApp:
|
|
| 91 |
def translate_with_chatgpt(self, text, source_lang, target_lang, api_key):
|
| 92 |
client = OpenAI(api_key=api_key)
|
| 93 |
response = client.chat.completions.create(
|
| 94 |
-
model="gpt-
|
| 95 |
messages=[
|
| 96 |
{"role": "system", "content": f"Translate from {source_lang} to {target_lang}:"},
|
| 97 |
{"role": "user", "content": text},
|
|
@@ -124,9 +124,9 @@ class TranslatorApp:
|
|
| 124 |
|
| 125 |
model = {
|
| 126 |
"DeepSeek": "deepseek-chat",
|
| 127 |
-
"ChatGPT": "gpt-
|
| 128 |
"Mistral": "mistral-tiny"
|
| 129 |
-
}.get(api_provider, "gpt-
|
| 130 |
|
| 131 |
response = client.chat.completions.create(
|
| 132 |
model=model,
|
|
|
|
| 91 |
def translate_with_chatgpt(self, text, source_lang, target_lang, api_key):
|
| 92 |
client = OpenAI(api_key=api_key)
|
| 93 |
response = client.chat.completions.create(
|
| 94 |
+
model="gpt-4o",
|
| 95 |
messages=[
|
| 96 |
{"role": "system", "content": f"Translate from {source_lang} to {target_lang}:"},
|
| 97 |
{"role": "user", "content": text},
|
|
|
|
| 124 |
|
| 125 |
model = {
|
| 126 |
"DeepSeek": "deepseek-chat",
|
| 127 |
+
"ChatGPT": "gpt-4o",
|
| 128 |
"Mistral": "mistral-tiny"
|
| 129 |
+
}.get(api_provider, "gpt-4o")
|
| 130 |
|
| 131 |
response = client.chat.completions.create(
|
| 132 |
model=model,
|