ShebMichel commited on
Commit
d12aaa0
·
verified ·
1 Parent(s): f3ad576

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -12
app.py CHANGED
@@ -52,19 +52,17 @@ def load_model(model_name):
52
  geomodel_llm = keras_nlp.models.CausalLM.from_preset(str(model_name))
53
  return geomodel_llm
54
 
55
-
56
-
57
  def model_launch(input):
58
- return f"Model: {first_model}\n\nResponse to: {input}"
59
- # geomodel_llm=load_model(first_model)
60
- # template = "Instruction:\n{instruction}\n\nResponse:\n{response}"
61
- # prompt = template.format(
62
- # instruction=input,
63
- # response="",
64
- # )
65
- # out = geomodel_llm.generate(prompt, max_length=1024)
66
- # ind = out.index('Response') + len('Response')+2
67
- # return out[ind:]
68
 
69
  # Global variable to store loaded JSON data
70
  loaded_data = {}
 
52
  geomodel_llm = keras_nlp.models.CausalLM.from_preset(str(model_name))
53
  return geomodel_llm
54
 
 
 
55
  def model_launch(input):
56
+ #return f"Model: {first_model}\n\nResponse to: {input}"
57
+ geomodel_llm=load_model(first_model)
58
+ template = "Instruction:\n{instruction}\n\nResponse:\n{response}"
59
+ prompt = template.format(
60
+ instruction=input,
61
+ response="",
62
+ )
63
+ out = geomodel_llm.generate(prompt, max_length=1024)
64
+ ind = out.index('Response') + len('Response')+2
65
+ return out[ind:]
66
 
67
  # Global variable to store loaded JSON data
68
  loaded_data = {}