mmshaban commited on
Commit
efdc3d7
·
verified ·
1 Parent(s): a000cf4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -4
app.py CHANGED
@@ -28,7 +28,8 @@ system_message = (
28
  "Always include the Arabic terminology, its transliteration using the full transliteration system, and its English meaning. "
29
  "When offering examples, prioritize Islamic Salafi references, such as *ahadith* (prophetic traditions), Quranic verses, and works of Salafi scholars or poets. "
30
  "Guide students on their mistakes with patience and encouragement, breaking down complex concepts into manageable steps for easier learning. "
31
- "Conclude each response with a warm and supportive remark, such as, 'Thank you for using the Arabic Tutor service from اللسان العربي.'"
 
32
  )
33
 
34
 
@@ -59,11 +60,21 @@ def stream_gpt(prompt):
59
  view = gr.Interface(
60
  fn=stream_gpt,
61
  inputs=gr.Textbox(lines=5, placeholder="Enter Arabic Word", label="Enter the Arabic word you want to learn about"),
62
- outputs=gr.Markdown(label="Translation and grammatical benefits"),
63
  examples=["كتاب", "كيف حالك؟", "مدرسة"],
64
  title="The FaseehAI Arabic Word Explorer",
65
  description="Type an Arabic word to get its translation and grammatical insights!",
66
  flagging_mode="never" # This should be part of the same function call
67
  )
68
-
69
- view.launch()
 
 
 
 
 
 
 
 
 
 
 
28
  "Always include the Arabic terminology, its transliteration using the full transliteration system, and its English meaning. "
29
  "When offering examples, prioritize Islamic Salafi references, such as *ahadith* (prophetic traditions), Quranic verses, and works of Salafi scholars or poets. "
30
  "Guide students on their mistakes with patience and encouragement, breaking down complex concepts into manageable steps for easier learning. "
31
+ "Conclude each response with a warm and supportive remark, such as, 'Thank you for using the Arabic Tutor service from FaseehAI.'"
32
+ "Make sure there is an empty line before that line"
33
  )
34
 
35
 
 
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
+ #output-box {
71
+ font-size: 20px; /* Adjust font size as needed */
72
+ line-height: 1.6; /* Optional: Adjust line height for readability */
73
+ border: 2px solid #ccc; /* Add a border around the box */
74
+ border-radius: 8px; /* Optional: Round the corners */
75
+ padding: 15px; /* Add some padding inside the box */
76
+ background-color: #f9f9f9; /* Light background for the box */
77
+ box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1); /* Optional: Add a subtle shadow */
78
+ }
79
+ """
80
+ view.launch()