Update app.py
Browse files
app.py
CHANGED
@@ -77,6 +77,8 @@ def generate_transliteration_gemini_15_pro(text):
|
|
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 |
|
82 |
|
|
|
77 |
clean_text = lambda res: res.replace("```json", "").replace("```", "").replace("\n", "")
|
78 |
print(response.text)
|
79 |
data = json.loads(clean_text(response.text))
|
80 |
+
if type(data) is list:
|
81 |
+
data = data[0]
|
82 |
return clean_hindi_transliterated_text(data["transliterate"])
|
83 |
|
84 |
|