Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -119,8 +119,8 @@ body {
|
|
| 119 |
}
|
| 120 |
|
| 121 |
.gr-button {
|
| 122 |
-
background-color:
|
| 123 |
-
color:
|
| 124 |
}
|
| 125 |
|
| 126 |
.gr-button:hover {
|
|
@@ -174,6 +174,24 @@ label {
|
|
| 174 |
color: blue !important;
|
| 175 |
}
|
| 176 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 177 |
"""
|
| 178 |
# Function to check if the file is a valid PDF in Arabic and less than 10MB
|
| 179 |
def validate_pdf(pdf):
|
|
@@ -236,7 +254,7 @@ def chat(user_input):
|
|
| 236 |
return assistant_response, audio_file
|
| 237 |
|
| 238 |
with gr.Blocks(css=custom_css) as demo:
|
| 239 |
-
|
| 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)
|
|
|
|
| 119 |
}
|
| 120 |
|
| 121 |
.gr-button {
|
| 122 |
+
background-color: gray !important;
|
| 123 |
+
color: blue !important;
|
| 124 |
}
|
| 125 |
|
| 126 |
.gr-button:hover {
|
|
|
|
| 174 |
color: blue !important;
|
| 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):
|
|
|
|
| 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)
|