Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -15,7 +15,8 @@ LANGUAGES = {
|
|
15 |
"Hindi": "hi",
|
16 |
"Telugu": "te",
|
17 |
"Kannada": "kn",
|
18 |
-
"Malayalam": "ml"
|
|
|
19 |
}
|
20 |
|
21 |
# Function to scrape content from a URL
|
@@ -35,9 +36,7 @@ def translate_content(content, target_language):
|
|
35 |
if target_language == "en":
|
36 |
return content # No translation needed
|
37 |
|
38 |
-
prompt = f"Translate the following content to {target_language}
|
39 |
-
|
40 |
-
{content}"
|
41 |
response = openai.chat.completions.create(
|
42 |
model="gpt-4o-mini",
|
43 |
messages=[
|
|
|
15 |
"Hindi": "hi",
|
16 |
"Telugu": "te",
|
17 |
"Kannada": "kn",
|
18 |
+
"Malayalam": "ml",
|
19 |
+
"Tamil": "ta"
|
20 |
}
|
21 |
|
22 |
# Function to scrape content from a URL
|
|
|
36 |
if target_language == "en":
|
37 |
return content # No translation needed
|
38 |
|
39 |
+
prompt = f"Translate the following content to {target_language}:\n\n{content}"
|
|
|
|
|
40 |
response = openai.chat.completions.create(
|
41 |
model="gpt-4o-mini",
|
42 |
messages=[
|