BilalSardar commited on
Commit
88990b7
·
verified ·
1 Parent(s): f8b4515

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -1,6 +1,8 @@
1
  from huggingface_hub import InferenceClient
2
  import gradio as gr
 
3
 
 
4
  client = InferenceClient(
5
  "mistralai/Mixtral-8x7B-Instruct-v0.1"
6
  )
@@ -26,9 +28,13 @@ def format_prompt(message, history):
26
  return prompt
27
 
28
  def generate(
29
- time,ward,p,pn,on,loc,adinfo, history='', temperature=0.9, max_new_tokens=256, top_p=0.95, repetition_penalty=1.0,
30
  ):
31
- prompt="time was:"+time+ " Ward was: "+ward+", Addenbrookes Hospital "+" Patient Name is:"+p+" Patient Number is: "+pn+" Officer Name is: "+on +" Patient Location was: "+loc +" Additional information to better understand the incident: "+ adinfo
 
 
 
 
32
  temperature = float(temperature)
33
  if temperature < 1e-2:
34
  temperature = 1e-2
 
1
  from huggingface_hub import InferenceClient
2
  import gradio as gr
3
+ from datetime import date
4
 
5
+ today = date.today()
6
  client = InferenceClient(
7
  "mistralai/Mixtral-8x7B-Instruct-v0.1"
8
  )
 
28
  return prompt
29
 
30
  def generate(
31
+ time,ward,p,pn,on,loc,adinfo, history='', temperature=0.9, max_new_tokens=1000, top_p=0.95, repetition_penalty=1.0,
32
  ):
33
+ # Month abbreviation, day and year
34
+ d4 = today.strftime("%b-%d-%Y")
35
+ print("d4 =", d4)
36
+
37
+ prompt="Date is:"+d4+" time was:"+time+ " Ward was: "+ward+", Addenbrookes Hospital "+" Patient Name is:"+p+" Patient Number is: "+pn+" Officer Name is: "+on +" Patient Location was: "+loc +" Additional information to better understand the incident: "+ adinfo
38
  temperature = float(temperature)
39
  if temperature < 1e-2:
40
  temperature = 1e-2