EmmaGozie commited on
Commit
eb6af71
·
verified ·
1 Parent(s): ec58d60

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -35,16 +35,16 @@ body::before {
35
  """
36
 
37
 
38
- gemma_lm = keras_nlp.models.CausalLM.from_preset("hf://EmmaGozie/gemma-medic-bot-2b-2n")
39
 
40
  def launch(input):
41
- template = "Question:\n{Question}\n\nAnswer:\n{Answer}"
42
  prompt = template.format(
43
  instruction=input,
44
- Answer="",
45
  )
46
- out = gemma_lm.generate(prompt, max_length=512)
47
- ind = out.index('Answer') + len('Answer')+2
48
  return out[ind:]
49
 
50
  iface = gr.Interface(launch,
 
35
  """
36
 
37
 
38
+ gemma_lm = keras_nlp.models.CausalLM.from_preset("hf://EmmaGozie/Medic-bot-2b-en")
39
 
40
  def launch(input):
41
+ template = "Instruction:\n{instruction}\n\nResponse:\n{response}"
42
  prompt = template.format(
43
  instruction=input,
44
+ response="",
45
  )
46
+ out = gemma_lm.generate(prompt, max_length=1024)
47
+ ind = out.index('Response') + len('Response')+2
48
  return out[ind:]
49
 
50
  iface = gr.Interface(launch,