MohammedNasser commited on
Commit
f1748f6
1 Parent(s): ef63d06

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -21
app.py CHANGED
@@ -175,24 +175,7 @@ label {
175
  }
176
 
177
  """
178
- custom_js = """
179
- <script>
180
- window.onload = function() {
181
- const chatInput = document.querySelector('textarea[data-testid="textbox-input"]');
182
- const chatOutput = document.querySelector('textarea[data-testid="textbox-output"]');
183
-
184
- if (chatInput) {
185
- chatInput.style.direction = 'rtl';
186
- chatInput.style.textAlign = 'right';
187
- }
188
-
189
- if (chatOutput) {
190
- chatOutput.style.direction = 'rtl';
191
- chatOutput.style.textAlign = 'right';
192
- }
193
- };
194
- </script>
195
- """
196
  # Function to check if the file is a valid PDF in Arabic and less than 10MB
197
  def validate_pdf(pdf):
198
  if pdf is None:
@@ -254,12 +237,11 @@ def chat(user_input):
254
  return assistant_response, audio_file
255
 
256
  with gr.Blocks(css=custom_css) as demo:
257
- gr.HTML(custom_js)
258
  pdf_input = gr.File(label="اختر ملف PDF")
259
  output_label = gr.HTML(value='') # Replaced Textbox with HTML for label
260
  submit_button_pdf = gr.Button("ارفع الملف", interactive=False)
261
- chat_input = gr.Textbox(label="")
262
- chat_output = gr.Textbox(label="")
263
  audio_output = gr.Audio(label="🔊", interactive=False)
264
  submit_button_chat = gr.Button("إرسال", interactive=False)
265
 
 
175
  }
176
 
177
  """
178
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
179
  # Function to check if the file is a valid PDF in Arabic and less than 10MB
180
  def validate_pdf(pdf):
181
  if pdf is None:
 
237
  return assistant_response, audio_file
238
 
239
  with gr.Blocks(css=custom_css) as demo:
 
240
  pdf_input = gr.File(label="اختر ملف PDF")
241
  output_label = gr.HTML(value='') # Replaced Textbox with HTML for label
242
  submit_button_pdf = gr.Button("ارفع الملف", interactive=False)
243
+ chat_input = gr.Textbox(label="", rtl=True)
244
+ chat_output = gr.Textbox(label="", rtl=True)
245
  audio_output = gr.Audio(label="🔊", interactive=False)
246
  submit_button_chat = gr.Button("إرسال", interactive=False)
247