khalednabawi11 commited on
Commit
0b8a0e0
·
verified ·
1 Parent(s): 52f0c48

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -253,7 +253,7 @@ pipe = TextGenerationPipeline(
253
  )
254
 
255
  # Prompt formatter based on language
256
- def generate_prompt(message, history):
257
  lang = detect(message)
258
  if lang == "ar":
259
  return f"""أجب على السؤال الطبي التالي بلغة عربية فصحى، بإجابة دقيقة ومفصلة. إذا لم تجد معلومات كافية في السياق، استخدم معرفتك الطبية السابقة.
@@ -270,8 +270,8 @@ Answer:"""
270
 
271
  # Chat function
272
  @app.post("/ask")
273
- def chat_fn(message, history):
274
- prompt = generate_prompt(message, history)
275
  response = pipe(prompt,
276
  max_new_tokens=512,
277
  temperature=0.7,
 
253
  )
254
 
255
  # Prompt formatter based on language
256
+ def generate_prompt(message):
257
  lang = detect(message)
258
  if lang == "ar":
259
  return f"""أجب على السؤال الطبي التالي بلغة عربية فصحى، بإجابة دقيقة ومفصلة. إذا لم تجد معلومات كافية في السياق، استخدم معرفتك الطبية السابقة.
 
270
 
271
  # Chat function
272
  @app.post("/ask")
273
+ def chat_fn(message):
274
+ prompt = generate_prompt(message)
275
  response = pipe(prompt,
276
  max_new_tokens=512,
277
  temperature=0.7,