sagar007 commited on
Commit
f73fa89
·
verified ·
1 Parent(s): 79cf235

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -71,7 +71,13 @@ def perform_bpe(text):
71
 
72
  return result, ' '.join(encoded_text)
73
 
 
 
 
 
 
74
 
 
75
  custom_css = """
76
  <style>
77
  body {
@@ -150,7 +156,7 @@ custom_css = """
150
  """
151
 
152
  # HTML Template
153
- html_template = f"""
154
  <div class="container">
155
  <h1>🇮🇳 Byte Pair Encoding for Hindi</h1>
156
  <p style="text-align: center; margin-bottom: 20px; color: rgba(255, 255, 255, 0.8);">
 
71
 
72
  return result, ' '.join(encoded_text)
73
 
74
+ def bpe_app(input_text):
75
+ if not input_text:
76
+ input_text = "नमस्ते! यह एक उदाहरण हिंदी वाक्य है। आप अपना खुद का पाठ यहां दर्ज कर सकते हैं।"
77
+ stats, encoded_text = perform_bpe(input_text)
78
+ return stats, encoded_text
79
 
80
+ # Custom CSS
81
  custom_css = """
82
  <style>
83
  body {
 
156
  """
157
 
158
  # HTML Template
159
+ html_template = """
160
  <div class="container">
161
  <h1>🇮🇳 Byte Pair Encoding for Hindi</h1>
162
  <p style="text-align: center; margin-bottom: 20px; color: rgba(255, 255, 255, 0.8);">