Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -35,16 +35,16 @@ body::before {
|
|
35 |
"""
|
36 |
|
37 |
|
38 |
-
gemma_lm = keras_nlp.models.CausalLM.from_preset("hf://EmmaGozie/
|
39 |
|
40 |
def launch(input):
|
41 |
-
template = "
|
42 |
prompt = template.format(
|
43 |
instruction=input,
|
44 |
-
|
45 |
)
|
46 |
-
out = gemma_lm.generate(prompt, max_length=
|
47 |
-
ind = out.index('
|
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,
|