AlphaWice commited on
Commit
63f1c24
ยท
verified ยท
1 Parent(s): 0664c5b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +109 -110
app.py CHANGED
@@ -1,18 +1,21 @@
1
  import gradio as gr
2
  import torch
3
- from transformers import pipeline, AutoTokenizer, AutoModelForSeq2SeqLM
 
4
  import re
 
 
5
 
6
- # Global variables to store the models
 
 
 
 
7
  atlas_pipe = None
8
- transliteration_tokenizer = None
9
- transliteration_model = None
10
 
11
- def load_models():
12
- """Load both Atlas-Chat and Transliteration models"""
13
- global atlas_pipe, transliteration_tokenizer, transliteration_model
14
-
15
- # Load Atlas-Chat model
16
  if atlas_pipe is None:
17
  print("๐Ÿ”๏ธ Loading Atlas-Chat-2B model...")
18
  atlas_pipe = pipeline(
@@ -22,15 +25,7 @@ def load_models():
22
  device="cuda" if torch.cuda.is_available() else "cpu"
23
  )
24
  print("โœ… Atlas-Chat model loaded!")
25
-
26
- # Load Transliteration model
27
- if transliteration_tokenizer is None or transliteration_model is None:
28
- print("๐Ÿ”„ Loading Transliteration model...")
29
- transliteration_tokenizer = AutoTokenizer.from_pretrained("atlasia/Transliteration-Moroccan-Darija")
30
- transliteration_model = AutoModelForSeq2SeqLM.from_pretrained("atlasia/Transliteration-Moroccan-Darija")
31
- print("โœ… Transliteration model loaded!")
32
-
33
- return atlas_pipe, transliteration_tokenizer, transliteration_model
34
 
35
  def detect_arabizi(text):
36
  """
@@ -89,40 +84,70 @@ def detect_arabizi(text):
89
 
90
  return False
91
 
92
- def arabizi_to_arabic_ai(arabizi_text):
93
  """
94
- Convert Arabizi text to Arabic using the specialized AI model
95
  """
96
  try:
97
- _, tokenizer, model = load_models()
 
 
 
98
 
99
- # Tokenize the input text
100
- input_tokens = tokenizer(arabizi_text, return_tensors="pt", padding=True, truncation=True, max_length=512)
101
 
102
- # Perform transliteration
103
- with torch.no_grad():
104
- output_tokens = model.generate(
105
- **input_tokens,
106
- max_length=512,
107
- num_beams=4,
108
- early_stopping=True,
109
- no_repeat_ngram_size=2
110
- )
111
 
112
- # Decode the output tokens
113
- arabic_text = tokenizer.decode(output_tokens[0], skip_special_tokens=True)
114
-
115
- return arabic_text.strip()
116
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117
  except Exception as e:
118
- print(f"โŒ Error in Arabiziโ†’Arabic conversion: {e}")
119
- # Fallback to original text if conversion fails
120
  return arabizi_text
121
 
122
  def arabic_to_arabizi(arabic_text):
123
  """
124
- Convert Arabic script to Arabizi using character mappings
125
- (Keeping this as backup since no reverse model available)
126
  """
127
  if not arabic_text:
128
  return arabic_text
@@ -151,35 +176,17 @@ def arabic_to_arabizi(arabic_text):
151
  'ุทุงุฌูŠู†': 'tajine', 'ุฃุชุงูŠ': 'atay', 'ุฎูˆุจุฒ': 'khobz',
152
  'ูƒุงูŠู†': 'kayn', 'ู…ุงูƒุงูŠู†ุด': 'makaynsh', 'ุดูŠ': 'chi',
153
  'ุฒูˆูŠู†': 'zwin', 'ุฒูˆูŠู†ุง': 'zwina', 'ู…ุฒูŠุงู†': 'mzyan', 'ู…ุฒูŠุงู†ุง': 'mzyana',
154
- 'ุฏุฑุช': 'dert', 'ุฏุฑุชูŠ': 'derti', 'ุฏุงุฑ': 'dar', 'ุฏุฑุงุช': 'derat',
155
- 'ู…ุดูŠุช': 'mchit', 'ู…ุดูŠุชูŠ': 'mchiti', 'ู…ุดุง': 'mcha', 'ู…ุดุงุช': 'mchat',
156
- 'ุฌูŠุช': 'jit', 'ุฌูŠุชูŠ': 'jiti', 'ุฌุง': 'ja', 'ุฌุงุช': 'jat',
157
- 'ุดูุช': 'cheft', 'ุดูุชูŠ': 'chefti', 'ุดุงู': 'chaf', 'ุดุงูุช': 'chafat',
158
- 'ุณู…ุนุช': 'sme3t', 'ุณู…ุนุชูŠ': 'sme3ti', 'ุณู…ุน': 'sma3', 'ุณู…ุนุงุช': 'sma3at',
159
- 'ุฃูƒู„ุช': 'klit', 'ุฃูƒู„ุชูŠ': 'kliti', 'ูƒู„ุง': 'kla', 'ูƒู„ุงุช': 'klat',
160
- 'ุดุฑุจุช': 'chrebt', 'ุดุฑุจุชูŠ': 'chrebti', 'ุดุฑุจ': 'chreb', 'ุดุฑุจุงุช': 'chrebat',
161
- 'ู†ุนุณุช': 'ne3st', 'ู†ุนุณุชูŠ': 'ne3sti', 'ู†ุนุณ': 'ne3s', 'ู†ุนุณุงุช': 'ne3sat',
162
- 'ุฎุฑุฌุช': 'khrjt', 'ุฎุฑุฌุชูŠ': 'khrjti', 'ุฎุฑุฌ': 'khrj', 'ุฎุฑุฌุงุช': 'khrjat',
163
- 'ุฏุฎู„ุช': 'dkhlt', 'ุฏุฎู„ุชูŠ': 'dkhlti', 'ุฏุฎู„': 'dkhl', 'ุฏุฎู„ุงุช': 'dkhlat',
164
- 'ู‚ุฑูŠุช': 'qrit', 'ู‚ุฑูŠุชูŠ': 'qriti', 'ู‚ุฑุง': 'qra', 'ู‚ุฑุงุช': 'qrat',
165
- 'ูƒุชุจุช': 'ktebt', 'ูƒุชุจุชูŠ': 'ktebti', 'ูƒุชุจ': 'kteb', 'ูƒุชุจุงุช': 'ktebat',
166
- 'ู„ุนุจุช': 'l3ebt', 'ู„ุนุจุชูŠ': 'l3ebti', 'ู„ุนุจ': 'l3eb', 'ู„ุนุจุงุช': 'l3ebat',
167
- 'ุฎุฏู…ุช': 'khdmt', 'ุฎุฏู…ุชูŠ': 'khdmti', 'ุฎุฏู…': 'khdm', 'ุฎุฏู…ุงุช': 'khdmat',
168
- 'ุตู„ูŠุช': 'sllit', 'ุตู„ูŠุชูŠ': 'slliti', 'ุตู„ุง': 'slla', 'ุตู„ุงุช': 'sllat',
169
- 'ุทุจุฎุช': '6bkht', 'ุทุจุฎุชูŠ': '6bkhti', 'ุทุจุฎ': '6bekh', 'ุทุจุฎุงุช': '6bekhat',
170
- 'ูˆุงุญุฏ': 'wa7ed', 'ุฌูˆุฌ': 'joj', 'ุชู„ุงุชุง': 'tlata', 'ุฑุจุนุง': 'reb3a',
171
- 'ุฎู…ุณุง': 'khamsa', 'ุณุชุง': 'setta', 'ุณุจุนุง': 'seb3a', 'ุชู…ู†ูŠุง': 'tmnya',
172
- 'ุชุณุนุง': 'tes3a', 'ุนุดุฑุง': '3echra', 'ุญุฏุงุด': '7dach', 'ุทู†ุงุด': '6nach',
173
- 'ู†ู‡ุงุฑ': 'nhar', 'ู„ูŠู„ุง': 'lila', 'ุตุจุงุญ': 'sba7', 'ุนุดูŠุง': '3echiya',
174
- 'ุฃู…ุณ': 'ems', 'ุงู„ุจุงุฑุญ': 'lbare7', 'ุบุฏุง': 'ghda', 'ุจุนุฏ ุบุฏุง': 'b3d ghda',
175
- 'ุฏุงุฑ': 'dar', 'ุจูŠุช': 'bit', 'ุดุงุฑุน': 'char3', 'ู…ุฏูŠู†ุง': 'mdina',
176
- 'ูƒุฑู‡ูˆุจุง': 'karhouba', 'ุทูˆู…ูˆุจูŠู„': 'tomobil', 'ู‚ุทุงุฑ': 'q6ar', 'ุจุงุต': 'bas',
177
- 'ู…ุงูƒู„ุง': 'makla', 'ุดุฑุงุจ': 'chrab', 'ู„ู…ุง': 'lma', 'ุนุทุด': '36ch',
178
- 'ุฌูˆุน': 'jo3', 'ุดุจุนุงู†': 'cheb3an', 'ุนูŠุงู†': '3yyan', 'ุตุญูŠุญ': 's7i7',
179
- 'ู…ุฑูŠุถ': 'mrid', 'ุฏูƒุชูˆุฑ': 'doktor', 'ุณุจูŠุทุงุฑ': 'sbitar', 'ุฏูˆุง': 'dwa',
180
- 'ูู„ูˆุณ': 'flous', 'ุฏุฑู‡ู…': 'derhem', 'ุฑูŠุงู„': 'riyal', 'ุงู„ูŠูˆุฑูˆ': 'lyoro',
181
- 'ุฎุฏู…ุง': 'khedma', 'ู…ุนู„ู…': 'mo3alim', 'ุทุงู„ุจ': 'talib', 'ุฃุณุชุงุฐ': 'ostaz',
182
- 'ูƒุชุงุจ': 'ktab', 'ู‚ู„ู…': 'qalam', 'ูƒุงุบุท': 'kaghet', 'ุทุงูˆู„ุง': 'tabla'
183
  }
184
 
185
  # CHARACTER MAPPINGS (Arabic โ†’ Arabizi)
@@ -196,7 +203,7 @@ def arabic_to_arabizi(arabic_text):
196
 
197
  result = arabic_text
198
 
199
- # Step 1: Apply word mappings
200
  for arabic_word, arabizi_word in word_mappings.items():
201
  # Use word boundaries to avoid partial matches
202
  result = re.sub(r'\b' + re.escape(arabic_word) + r'\b', arabizi_word, result)
@@ -208,39 +215,36 @@ def arabic_to_arabizi(arabic_text):
208
  return result.strip()
209
 
210
  def chat_with_atlas(message, history):
211
- """Generate response from Atlas-Chat model with AI-powered Arabizi conversion"""
212
  if not message.strip():
213
  return "ahlan wa sahlan! kifash n9der n3awnek? / ู…ุฑุญุจุง! ูƒูŠูุงุด ู†ู‚ุฏุฑ ู†ุนุงูˆู†ูƒุŸ"
214
 
215
  try:
216
- # Load models
217
- atlas_model, _, _ = load_models()
218
 
219
  # Detect if input is Arabizi
220
  is_arabizi_input = detect_arabizi(message)
221
 
222
- print("\n" + "="*60)
223
- print("๐Ÿ” DEBUG LOG - FULL CONVERSION PIPELINE")
224
- print("="*60)
225
- print(f"๐Ÿ“ฅ ORIGINAL INPUT: '{message}'")
226
- print(f"๐Ÿค– ARABIZI DETECTED: {is_arabizi_input}")
227
 
228
  # Prepare input for the model
229
  if is_arabizi_input:
230
- # Convert Arabizi to Arabic using AI model
231
- print(f"\n๐Ÿ”„ STEP 1: Converting Arabizi to Arabic...")
232
- arabic_input = arabizi_to_arabic_ai(message)
233
- print(f"โœ… ARABIC CONVERSION: '{arabic_input}'")
234
  model_input = arabic_input
235
  else:
236
- # Use original input (Arabic or English)
237
- print(f"\nโžก๏ธ NO CONVERSION NEEDED - Using original input")
238
  model_input = message
239
 
240
- print(f"\n๐Ÿค– STEP 2: Sending to Atlas-Chat model...")
241
- print(f"๐Ÿ“ค MODEL INPUT: '{model_input}'")
242
 
243
- # Generate response using Arabic input
244
  messages = [{"role": "user", "content": model_input}]
245
 
246
  outputs = atlas_model(
@@ -253,28 +257,22 @@ def chat_with_atlas(message, history):
253
 
254
  # Extract the response
255
  response = outputs[0]["generated_text"][-1]["content"].strip()
256
- print(f"โœ… MODEL RESPONSE (Arabic): '{response}'")
257
 
258
  # Convert response back to Arabizi if input was Arabizi
259
  if is_arabizi_input:
260
- print(f"\n๐Ÿ”„ STEP 3: Converting response back to Arabizi...")
261
  arabizi_response = arabic_to_arabizi(response)
262
- print(f"โœ… FINAL ARABIZI RESPONSE: '{arabizi_response}'")
263
- print("="*60)
264
- print("๐ŸŽฏ FINAL OUTPUT TO USER:", arabizi_response)
265
- print("="*60 + "\n")
266
  return arabizi_response
267
  else:
268
- # Return original response for Arabic/English
269
- print(f"\nโžก๏ธ NO BACK-CONVERSION NEEDED")
270
- print("="*60)
271
- print("๐ŸŽฏ FINAL OUTPUT TO USER:", response)
272
- print("="*60 + "\n")
273
  return response
274
 
275
  except Exception as e:
276
- print(f"\nโŒ ERROR OCCURRED: {str(e)}")
277
- print("="*60 + "\n")
278
  # Return error in appropriate language
279
  if detect_arabizi(message):
280
  return f"sorry, kan chi mochkil: {str(e)}. 3awd jar'b!"
@@ -284,19 +282,20 @@ def chat_with_atlas(message, history):
284
  # Create the Gradio interface
285
  demo = gr.ChatInterface(
286
  fn=chat_with_atlas,
287
- title="๐Ÿ”๏ธ Atlas-Chat: Advanced Moroccan Arabic AI",
288
  description="""
289
- **ู…ุฑุญุจุง ุจูƒ ููŠ ุฃุทู„ุณ ุดุงุช ุงู„ู…ุทูˆุฑ!** Welcome to Advanced Atlas-Chat! ๐Ÿ‡ฒ๐Ÿ‡ฆ
290
 
291
- **๐Ÿง  AI-Powered Language Detection & Conversion:**
292
- - **Arabic Script (ุงู„ุนุฑุจูŠุฉ)** โ†’ AI responds in Arabic
293
- - **Arabizi (3arabi bi 7oruf latin)** โ†’ AI-powered conversion โ†’ Arabizi response
294
- - **English** โ†’ AI responds in English
295
 
296
- **โšก Professional Arabizi Conversion**
297
- - Uses specialized AI model trained on Moroccan Darija
298
- - Perfect understanding of context: "kayn chi" โ†’ "ูƒุงูŠู† ุดูŠ"
299
- - Handles complex phrases accurately
 
300
 
301
  **ุฌุฑุจ ู‡ุฐู‡ ุงู„ุฃุณุฆู„ุฉ / Try these questions:**
302
  """,
 
1
  import gradio as gr
2
  import torch
3
+ from transformers import pipeline
4
+ import requests
5
  import re
6
+ import os
7
+ from huggingface_hub import login
8
 
9
+ # Authenticate with Hugging Face
10
+ if "HF_TOKEN" in os.environ:
11
+ login(token=os.environ["HF_TOKEN"])
12
+
13
+ # Global variable to store the Atlas-Chat model
14
  atlas_pipe = None
 
 
15
 
16
+ def load_atlas_model():
17
+ """Load only the Atlas-Chat model locally"""
18
+ global atlas_pipe
 
 
19
  if atlas_pipe is None:
20
  print("๐Ÿ”๏ธ Loading Atlas-Chat-2B model...")
21
  atlas_pipe = pipeline(
 
25
  device="cuda" if torch.cuda.is_available() else "cpu"
26
  )
27
  print("โœ… Atlas-Chat model loaded!")
28
+ return atlas_pipe
 
 
 
 
 
 
 
 
29
 
30
  def detect_arabizi(text):
31
  """
 
84
 
85
  return False
86
 
87
+ def arabizi_to_arabic_api(arabizi_text):
88
  """
89
+ Convert Arabizi text to Arabic using Hugging Face Inference API
90
  """
91
  try:
92
+ # Check if HF_TOKEN is available
93
+ if "HF_TOKEN" not in os.environ:
94
+ print("โŒ HF_TOKEN not found, falling back to original text")
95
+ return arabizi_text
96
 
97
+ API_URL = "https://api-inference.huggingface.co/models/atlasia/Transliteration-Moroccan-Darija"
98
+ headers = {"Authorization": f"Bearer {os.environ['HF_TOKEN']}"}
99
 
100
+ # Prepare the payload
101
+ payload = {
102
+ "inputs": arabizi_text,
103
+ "parameters": {
104
+ "max_length": 512,
105
+ "num_beams": 4,
106
+ "early_stopping": True
107
+ }
108
+ }
109
 
110
+ # Make API request with timeout
111
+ response = requests.post(API_URL, headers=headers, json=payload, timeout=30)
 
 
112
 
113
+ # Check if request was successful
114
+ if response.status_code == 200:
115
+ result = response.json()
116
+
117
+ # Handle different response formats
118
+ if isinstance(result, list) and len(result) > 0:
119
+ if "generated_text" in result[0]:
120
+ return result[0]["generated_text"].strip()
121
+ elif isinstance(result[0], str):
122
+ return result[0].strip()
123
+ elif isinstance(result, dict) and "generated_text" in result:
124
+ return result["generated_text"].strip()
125
+ elif isinstance(result, str):
126
+ return result.strip()
127
+ else:
128
+ print(f"โŒ Unexpected API response format: {result}")
129
+ return arabizi_text
130
+
131
+ elif response.status_code == 503:
132
+ print("โณ Model is loading, falling back to original text")
133
+ return arabizi_text
134
+ else:
135
+ print(f"โŒ API error {response.status_code}: {response.text}")
136
+ return arabizi_text
137
+
138
+ except requests.exceptions.Timeout:
139
+ print("โฐ API timeout, falling back to original text")
140
+ return arabizi_text
141
+ except requests.exceptions.RequestException as e:
142
+ print(f"โŒ API request failed: {e}")
143
+ return arabizi_text
144
  except Exception as e:
145
+ print(f"โŒ Unexpected error in API conversion: {e}")
 
146
  return arabizi_text
147
 
148
  def arabic_to_arabizi(arabic_text):
149
  """
150
+ Convert Arabic script to Arabizi using comprehensive hard-coded mappings
 
151
  """
152
  if not arabic_text:
153
  return arabic_text
 
176
  'ุทุงุฌูŠู†': 'tajine', 'ุฃุชุงูŠ': 'atay', 'ุฎูˆุจุฒ': 'khobz',
177
  'ูƒุงูŠู†': 'kayn', 'ู…ุงูƒุงูŠู†ุด': 'makaynsh', 'ุดูŠ': 'chi',
178
  'ุฒูˆูŠู†': 'zwin', 'ุฒูˆูŠู†ุง': 'zwina', 'ู…ุฒูŠุงู†': 'mzyan', 'ู…ุฒูŠุงู†ุง': 'mzyana',
179
+ 'ูƒุงูŠู†ูŠู†': 'kaynin', 'ู…ุทุนู…': 'ma63am', 'ู…ุทุงุนู…': 'ma6a3im',
180
+ 'ู…ุดู‡ูˆุฑ': 'mashhur', 'ู…ุดู‡ูˆุฑูŠู†': 'mashhurin', 'ูˆุณุท': 'wost',
181
+ 'ุงู„ู…ุฏูŠู†ุฉ': 'lmdina', 'ู…ุฏูŠู†ุฉ': 'mdina', 'ุฅูŠุทุงู„ูŠ': 'italiy',
182
+ 'ูŠุงุจุงู†ูŠ': 'yabani', 'ู…ุบุฑุจูŠ': 'maghribi', 'ูุฑู†ุณูŠ': 'fransi',
183
+ 'ุฃู…ุฑูŠูƒูŠ': 'amriki', 'ุตูŠู†ูŠ': 'sini', 'ู‡ู†ุฏูŠ': 'hindi',
184
+ 'ู„ุญู…': 'la7m', 'ุฏุฌุงุฌ': 'djaj', 'ุญูˆุช': '7ut', 'ุฎุถุฑุฉ': 'khodra',
185
+ 'ููˆุงูƒู‡': 'fawakeh', 'ุฌุจู†': 'jben', 'ุฒุจุฏุฉ': 'zebda', 'ุญู„ูŠุจ': '7lib',
186
+ 'ู‚ู‡ูˆุฉ': 'qahwa', 'ุดุงูŠ': 'atay', 'ู…ุงุก': 'ma', 'ุนุตูŠุฑ': '3asir',
187
+ 'ุฎุจุฒ': 'khobz', 'ุฑุฒ': 'roz', 'ู…ูƒุฑูˆู†ุฉ': 'makarona', 'ุจุทุงุทุง': 'batata',
188
+ 'ุทู…ุงุทู…': 'toma6im', 'ุจุตู„': 'basal', 'ุซูˆู…': 'tum', 'ูู„ูู„': 'felfel',
189
+ 'ู…ู„ุญ': 'mel7', 'ุณูƒุฑ': 'sokkar', 'ุฒูŠุช': 'zit', 'ุฎู„': 'khall'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
190
  }
191
 
192
  # CHARACTER MAPPINGS (Arabic โ†’ Arabizi)
 
203
 
204
  result = arabic_text
205
 
206
+ # Step 1: Apply word mappings (most specific first)
207
  for arabic_word, arabizi_word in word_mappings.items():
208
  # Use word boundaries to avoid partial matches
209
  result = re.sub(r'\b' + re.escape(arabic_word) + r'\b', arabizi_word, result)
 
215
  return result.strip()
216
 
217
  def chat_with_atlas(message, history):
218
+ """Generate response from Atlas-Chat model with API-powered Arabizi conversion"""
219
  if not message.strip():
220
  return "ahlan wa sahlan! kifash n9der n3awnek? / ู…ุฑุญุจุง! ูƒูŠูุงุด ู†ู‚ุฏุฑ ู†ุนุงูˆู†ูƒุŸ"
221
 
222
  try:
223
+ # Load Atlas-Chat model
224
+ atlas_model = load_atlas_model()
225
 
226
  # Detect if input is Arabizi
227
  is_arabizi_input = detect_arabizi(message)
228
 
229
+ print("\n" + "="*50)
230
+ print("๐Ÿ” ATLAS-CHAT DEBUG LOG")
231
+ print("="*50)
232
+ print(f"๐Ÿ“ฅ INPUT: '{message}'")
233
+ print(f"๐Ÿ” ARABIZI: {is_arabizi_input}")
234
 
235
  # Prepare input for the model
236
  if is_arabizi_input:
237
+ print("๐Ÿ”„ Converting Arabiziโ†’Arabic via API...")
238
+ arabic_input = arabizi_to_arabic_api(message)
239
+ print(f"โœ… ARABIC: '{arabic_input}'")
 
240
  model_input = arabic_input
241
  else:
242
+ print("โžก๏ธ No conversion needed")
 
243
  model_input = message
244
 
245
+ print(f"๐Ÿค– Sending to Atlas-Chat...")
 
246
 
247
+ # Generate response using Atlas-Chat
248
  messages = [{"role": "user", "content": model_input}]
249
 
250
  outputs = atlas_model(
 
257
 
258
  # Extract the response
259
  response = outputs[0]["generated_text"][-1]["content"].strip()
260
+ print(f"โœ… RESPONSE: '{response[:100]}{'...' if len(response) > 100 else ''}'")
261
 
262
  # Convert response back to Arabizi if input was Arabizi
263
  if is_arabizi_input:
264
+ print("๐Ÿ”„ Converting Arabicโ†’Arabizi...")
265
  arabizi_response = arabic_to_arabizi(response)
266
+ print(f"โœ… FINAL: '{arabizi_response[:100]}{'...' if len(arabizi_response) > 100 else ''}'")
267
+ print("="*50 + "\n")
 
 
268
  return arabizi_response
269
  else:
270
+ print("="*50 + "\n")
 
 
 
 
271
  return response
272
 
273
  except Exception as e:
274
+ print(f"\nโŒ ERROR: {str(e)}")
275
+ print("="*50 + "\n")
276
  # Return error in appropriate language
277
  if detect_arabizi(message):
278
  return f"sorry, kan chi mochkil: {str(e)}. 3awd jar'b!"
 
282
  # Create the Gradio interface
283
  demo = gr.ChatInterface(
284
  fn=chat_with_atlas,
285
+ title="๐Ÿ”๏ธ Atlas-Chat: AI-Powered Moroccan Arabic Assistant",
286
  description="""
287
+ **ู…ุฑุญุจุง ุจูƒ ููŠ ุฃุทู„ุณ ุดุงุช!** Welcome to Atlas-Chat! ๐Ÿ‡ฒ๐Ÿ‡ฆ
288
 
289
+ **๐Ÿš€ Powered by Hugging Face Inference API:**
290
+ - **Arabic Script (ุงู„ุนุฑุจูŠุฉ)** โ†’ Direct conversation
291
+ - **Arabizi (3arabi bi 7oruf latin)** โ†’ API conversion โ†’ Arabizi response
292
+ - **English** โ†’ Direct conversation
293
 
294
+ **โšก Features:**
295
+ - Professional AI Arabizi conversion via API
296
+ - No local model conflicts
297
+ - Fast and reliable responses
298
+ - Comprehensive language detection
299
 
300
  **ุฌุฑุจ ู‡ุฐู‡ ุงู„ุฃุณุฆู„ุฉ / Try these questions:**
301
  """,