mmshaban commited on
Commit
39fd047
·
verified ·
1 Parent(s): a0e61df

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -11
app.py CHANGED
@@ -59,28 +59,41 @@ def stream_gpt(prompt):
59
 
60
  view = gr.Interface(
61
  fn=stream_gpt,
62
- inputs=gr.Textbox(lines=5, placeholder="Enter Arabic Word", label="Enter the Arabic word you want to learn about"),
63
- outputs=gr.Markdown(label="Translation and grammatical benefits", elem_id="output-box"),
64
- # examples=["كتاب", "كيف حالك؟", "مدرسة"],
 
 
 
 
 
 
65
  title="The FaseehAI Arabic Word Explorer",
66
  description="Type an Arabic word to get its translation and grammatical insights!",
67
- flagging_mode="never" # This should be part of the same function call
 
 
 
 
 
 
68
  )
69
- view.css = """
70
 
 
 
71
  #output-box {
72
- font-size: 40px;
73
- line-height: 2;
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: auto;
80
  margin: auto;
81
- box-sizing: border-box; /* Ensure padding is included in width calculations */
82
- overflow-wrap: break-word; /* Prevent content from overflowing horizontally */
83
- word-wrap: break-word; /* Support for older browsers */
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