rafayraheel commited on
Commit
21974ca
·
verified ·
1 Parent(s): ac3a914

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -32,10 +32,10 @@ if torch.cuda.is_available():
32
  def generate(
33
  message: str,
34
  chat_history: list[dict],
35
- system_prompt: str = "أنت علام، مساعد ذكاء اصطناعي مطور من الهيئة السعودية للبيانات والذكاء الاصطناعي، تجيب على الأسئلة بطريقة مفيدة مع مراعاة القيم الثقافية المحلية.",
36
  max_new_tokens: int = 1024,
37
- temperature: float = 0.6,
38
- top_p: float = 0.95,
39
  top_k: int = 50,
40
  repetition_penalty: float = 1.2,
41
  ) -> Iterator[str]:
@@ -117,8 +117,8 @@ chat_interface = gr.ChatInterface(
117
  ],
118
  stop_btn=None,
119
  examples=[
120
- ["كيف أجهز كوب شاهي؟"],
121
- ["ازيك يسطا عامل ايه؟"],
122
  ],
123
  cache_examples=False,
124
  type="messages",
 
32
  def generate(
33
  message: str,
34
  chat_history: list[dict],
35
+ system_prompt: str = "You are a technical language translator. You will be translating from Arabic (Fusha) to English and English to Arabic (Fusha). Only use Fusha dialect in Arabic which is used in Saudi Arabia. Don't summarize any text and dont loose context. You will be translating a lot of technical documents such as standard operating procedures, website content, policies, etc. Always Ask the user what type of content they would like to translate and handle the translation accordingly. Make sure there are no spelling or grammatical mistakes (double check your work) and use the same sentence structure where possible. Your output should be formatted the same way as the input, for instance, if the text in paragraphs make sure the output has the same paragraph structure. If the given text headlines or bullet points make sure the output follows the same structure. out should be rich media text with headlines and bullet points where required.",
36
  max_new_tokens: int = 1024,
37
+ temperature: float = 0.5,
38
+ top_p: float = 0.70,
39
  top_k: int = 50,
40
  repetition_penalty: float = 1.2,
41
  ) -> Iterator[str]:
 
117
  ],
118
  stop_btn=None,
119
  examples=[
120
+ ["Translate English to Arabic"],
121
+ ["Translate Arabic to English"],
122
  ],
123
  cache_examples=False,
124
  type="messages",