Update app.py
Browse files
app.py
CHANGED
@@ -71,10 +71,11 @@ chat_session = model.start_chat(
|
|
71 |
|
72 |
def generate_transliteration_gemini_15_pro(text):
|
73 |
texts = [text]
|
74 |
-
chat_session.send_message(
|
75 |
'Given an English sentences: \n```' + "\n".join(texts) + '\n```\nTransliterate English sentences into a mix of Roman and Devanagari script, following a predefined pattern or learning from provided examples above without explain anything.\nReturn output in JSON in following format for the list of sentences: {"text": xxx, "transliterate": xxx}'
|
76 |
)
|
77 |
clean_text = lambda res: res.replace("```json", "").replace("```", "").replace("\n", "")
|
|
|
78 |
data = json.loads(clean_text(response.text))
|
79 |
return clean_hindi_transliterated_text(data["transliterate"])
|
80 |
|
|
|
71 |
|
72 |
def generate_transliteration_gemini_15_pro(text):
|
73 |
texts = [text]
|
74 |
+
response = chat_session.send_message(
|
75 |
'Given an English sentences: \n```' + "\n".join(texts) + '\n```\nTransliterate English sentences into a mix of Roman and Devanagari script, following a predefined pattern or learning from provided examples above without explain anything.\nReturn output in JSON in following format for the list of sentences: {"text": xxx, "transliterate": xxx}'
|
76 |
)
|
77 |
clean_text = lambda res: res.replace("```json", "").replace("```", "").replace("\n", "")
|
78 |
+
print(response.text)
|
79 |
data = json.loads(clean_text(response.text))
|
80 |
return clean_hindi_transliterated_text(data["transliterate"])
|
81 |
|