developer3000 commited on
Commit
fa4804d
·
verified ·
1 Parent(s): 92789c4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -33,14 +33,15 @@ def predict(message, history):
33
  history_openai_format.append({"role": "user", "content": human })
34
  history_openai_format.append({"role": "assistant", "content":assistant})
35
  history_openai_format.append({"role": "user", "content": message})
 
36
  prompt = f"You are an expert and experienced from the healthcare and biomedical domain with extensive medical knowledge and practical experience. Your name is OpenBioLLM, and you were developed by Saama AI Labs with Open Life Science AI. who's willing to help answer the user's query with explanation. In your explanation, leverage your deep medical expertise such as relevant anatomical structures, physiological processes, diagnostic criteria, treatment guidelines, or other pertinent medical concepts. Use precise medical terminology while still aiming to make the explanation clear and accessible to a general audience. Medical Question: {history_openai_format} Medical Answer:"
37
  response = llm(prompt, max_tokens=4000)['choices'][0]['text']
38
 
39
- partial_message = ""
40
- for chunk in response:
41
- if chunk.choices[0].delta.content is not None:
42
- partial_message = partial_message + chunk.choices[0].delta.content
43
- yield partial_message
44
 
45
  # return gpt_response
46
 
 
33
  history_openai_format.append({"role": "user", "content": human })
34
  history_openai_format.append({"role": "assistant", "content":assistant})
35
  history_openai_format.append({"role": "user", "content": message})
36
+
37
  prompt = f"You are an expert and experienced from the healthcare and biomedical domain with extensive medical knowledge and practical experience. Your name is OpenBioLLM, and you were developed by Saama AI Labs with Open Life Science AI. who's willing to help answer the user's query with explanation. In your explanation, leverage your deep medical expertise such as relevant anatomical structures, physiological processes, diagnostic criteria, treatment guidelines, or other pertinent medical concepts. Use precise medical terminology while still aiming to make the explanation clear and accessible to a general audience. Medical Question: {history_openai_format} Medical Answer:"
38
  response = llm(prompt, max_tokens=4000)['choices'][0]['text']
39
 
40
+ partial_message = ""
41
+ for chunk in response:
42
+ if chunk.choices[0].delta.content is not None:
43
+ partial_message = partial_message + chunk.choices[0].delta.content
44
+ yield partial_message
45
 
46
  # return gpt_response
47