Sshubam commited on
Commit
e7da371
·
verified ·
1 Parent(s): 93f4677

added longer examples + copy btn to messages + avatars

Browse files
Files changed (1) hide show
  1. app.py +20 -7
app.py CHANGED
@@ -237,11 +237,16 @@ with gr.Blocks(css=css) as demo:
237
  elem_id="language-dropdown",
238
  )
239
 
240
- chatbot = gr.Chatbot(height=400, elem_id="chatbot")
 
 
 
 
 
241
 
242
  with gr.Row():
243
  msg = gr.Textbox(
244
- placeholder="Enter text to translate...",
245
  show_label=False,
246
  container=False,
247
  scale=9,
@@ -250,13 +255,21 @@ with gr.Blocks(css=css) as demo:
250
 
251
  gr.Examples(
252
  examples=[
253
- "The Taj Mahal stands majestically along the banks of river Yamuna, a timeless symbol of eternal love.",
254
- "Kumbh Mela is the world's largest gathering of people, where millions of pilgrims bathe in sacred rivers for spiritual purification.",
255
- "India's classical dance forms like Bharatanatyam, Kathak, and Odissi beautifully blend rhythm, expression, and storytelling.",
256
- "Ayurveda, the ancient Indian medical system, focuses on holistic wellness through natural herbs and balanced living.",
257
- "During Diwali, homes across India are decorated with oil lamps, colorful rangoli patterns, and twinkling lights to celebrate the victory of light over darkness.",
 
 
 
 
 
 
 
258
  ],
259
  inputs=msg,
 
260
  )
261
 
262
  with gr.Accordion("Provide Feedback", open=True):
 
237
  elem_id="language-dropdown",
238
  )
239
 
240
+ chatbot = gr.Chatbot(
241
+ height=400,
242
+ elem_id="chatbot",
243
+ show_copy_button=True,
244
+ avatar_images=["avatars/user_logo.png", "avatars/ai4bharat_logo.png"]
245
+ )
246
 
247
  with gr.Row():
248
  msg = gr.Textbox(
249
+ placeholder="Enter a long paragraph to translate...",
250
  show_label=False,
251
  container=False,
252
  scale=9,
 
255
 
256
  gr.Examples(
257
  examples=[
258
+ "The Taj Mahal, an architectural marvel of white marble, stands majestically along the banks of the Yamuna River in Agra, India. Built by Mughal Emperor Shah Jahan in memory of his beloved wife, Mumtaz Mahal, it symbolizes eternal love and devotion. The monument, a UNESCO World Heritage site, attracts millions of visitors each year, who admire its intricate carvings, calligraphy, and symmetrical gardens. At sunrise and sunset, the marble dome glows in hues of pink and golden, creating a breathtaking spectacle. The Taj Mahal is not only a masterpiece of Mughal architecture but also a timeless representation of romance and artistry.",
259
+ "Kumbh Mela, the worlds largest spiritual gathering, is a significant Hindu festival held at four sacred riverbanks—Prayagraj, Haridwar, Nashik, and Ujjain—at intervals of 12 years. Millions of devotees, including sadhus, ascetics, and pilgrims, gather to take a holy dip in the river, believing it washes away sins and grants salvation. The festival is marked by grand processions, religious discourses, and vibrant cultural events. With its rich traditions, ancient rituals, and immense scale, Kumbh Mela is not just a religious event but also a profound representation of India’s spiritual and cultural heritage, fostering faith and unity among millions worldwide.",
260
+ "India's classical dance forms, such as Bharatanatyam, Kathak, Odissi, Kuchipudi, and Kathakali, are deeply rooted in tradition and storytelling. These dance styles blend intricate footwork, graceful hand gestures, and expressive facial expressions to narrate mythological tales and historical legends. Bharatanatyam, originating from Tamil Nadu, is known for its rhythmic precision, while Kathak, from North India, features rapid spins and foot-tapping movements. Odissi, from Odisha, showcases fluid postures inspired by temple sculptures. Each form carries a distinct cultural essence, preserving centuries-old traditions while continuing to evolve in contemporary performances, keeping India’s rich artistic heritage alive and thriving.",
261
+ "Ayurveda, India’s ancient medical system, emphasizes a holistic approach to health by balancing the mind, body, and spirit. Rooted in nature, it promotes well-being through herbal medicines, dietary guidelines, yoga, and meditation. Ayurveda classifies individuals based on three doshas—Vata, Pitta, and Kapha—determining their physical and mental constitution. Remedies include plant-based treatments, detox therapies, and rejuvenation practices to prevent and heal ailments. Unlike modern medicine, Ayurveda focuses on personalized healing and long-term wellness. With growing global interest in alternative medicine, Ayurveda continues to gain recognition for its effectiveness in promoting natural healing and overall health optimization.",
262
+ "Diwali, the festival of lights, is one of India’s most celebrated festivals, symbolizing the victory of light over darkness and good over evil. Families clean and decorate their homes with colorful rangoli, oil lamps, and twinkling fairy lights. The festival marks the return of Lord Rama to Ayodhya after defeating Ravana, and it also honors Goddess Lakshmi, the deity of wealth and prosperity. Fireworks illuminate the night sky, while families exchange sweets and gifts, spreading joy and togetherness. Beyond its religious significance, Diwali fosters unity, strengthens relationships, and brings communities together in a spirit of happiness and renewal.",
263
+ ],
264
+ example_labels=[
265
+ "The Taj Mahal, an architectural marvel of white marble, stands majestically along the banks of the Yamuna River in Agra...",
266
+ "Kumbh Mela, the world’s largest spiritual gathering, is a significant Hindu festival held at four sacred riverbanks...",
267
+ "India's classical dance forms, such as Bharatanatyam, Kathak, Odissi, Kuchipudi, and Kathakali, are deeply rooted in tradition...",
268
+ "Ayurveda, India’s ancient medical system, emphasizes a holistic approach to health by balancing the mind, body, and spirit...",
269
+ "Diwali, the festival of lights, is one of India’s most celebrated festivals, symbolizing the victory of light over darkness...",
270
  ],
271
  inputs=msg,
272
+ cache_examples=True
273
  )
274
 
275
  with gr.Accordion("Provide Feedback", open=True):