Update app.py
Browse files
app.py
CHANGED
@@ -59,28 +59,41 @@ def stream_gpt(prompt):
|
|
59 |
|
60 |
view = gr.Interface(
|
61 |
fn=stream_gpt,
|
62 |
-
inputs=gr.Textbox(
|
63 |
-
|
64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
title="The FaseehAI Arabic Word Explorer",
|
66 |
description="Type an Arabic word to get its translation and grammatical insights!",
|
67 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
)
|
69 |
-
view.css = """
|
70 |
|
|
|
|
|
71 |
#output-box {
|
72 |
-
font-size:
|
73 |
-
line-height:
|
74 |
border: 2px solid #ccc;
|
75 |
border-radius: 8px;
|
76 |
padding: 15px;
|
77 |
background-color: #f9f9f9;
|
78 |
box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
|
79 |
-
width:
|
80 |
margin: auto;
|
81 |
-
box-sizing: border-box;
|
82 |
-
overflow-wrap: break-word;
|
83 |
-
word-wrap: break-word;
|
84 |
}
|
85 |
"""
|
86 |
|
|
|
59 |
|
60 |
view = gr.Interface(
|
61 |
fn=stream_gpt,
|
62 |
+
inputs=gr.Textbox(
|
63 |
+
lines=5,
|
64 |
+
placeholder="Enter Arabic Word",
|
65 |
+
label="Enter the Arabic word you want to learn about"
|
66 |
+
),
|
67 |
+
outputs=gr.Markdown(
|
68 |
+
label="Translation and grammatical benefits",
|
69 |
+
elem_id="output-box"
|
70 |
+
),
|
71 |
title="The FaseehAI Arabic Word Explorer",
|
72 |
description="Type an Arabic word to get its translation and grammatical insights!",
|
73 |
+
examples=[
|
74 |
+
["كتاب"],
|
75 |
+
["كيف حالك؟"],
|
76 |
+
["مدرسة"]
|
77 |
+
], # Examples to guide users
|
78 |
+
flagging_dir=None, # Disable flagging completely
|
79 |
+
theme="compact" # Optional: Choose a theme for better appearance
|
80 |
)
|
|
|
81 |
|
82 |
+
# Add CSS for custom styling
|
83 |
+
view.css = """
|
84 |
#output-box {
|
85 |
+
font-size: 20px; /* Adjust for readability */
|
86 |
+
line-height: 1.6;
|
87 |
border: 2px solid #ccc;
|
88 |
border-radius: 8px;
|
89 |
padding: 15px;
|
90 |
background-color: #f9f9f9;
|
91 |
box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
|
92 |
+
max-width: 80%; /* Ensure it doesn't take too much space */
|
93 |
margin: auto;
|
94 |
+
box-sizing: border-box;
|
95 |
+
overflow-wrap: break-word;
|
96 |
+
word-wrap: break-word;
|
97 |
}
|
98 |
"""
|
99 |
|