lucaspetti commited on
Commit
8cbc163
·
verified ·
1 Parent(s): 0ec8839

Add developer prompt input

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -13,13 +13,13 @@ model = AutoModelForCausalLM.from_pretrained(
13
  token=hf_token
14
  )
15
 
16
- def process_request(user_prompt, tools_json):
17
  try:
18
  tools = json.loads(tools_json) if tools_json.strip() else []
19
 
20
  # FunctionGemma format
21
  messages = [
22
- {"role": "developer", "content": "You are a model that can do function calling with the following functions"},
23
  {"role": "user", "content": user_prompt}
24
  ]
25
 
@@ -41,7 +41,7 @@ def process_request(user_prompt, tools_json):
41
 
42
  demo = gr.Interface(
43
  fn=process_request,
44
- inputs=[gr.Textbox(label="User Prompt"), gr.Textbox(label="Tools (JSON Array)")],
45
  outputs=gr.Code(label="Model Output"),
46
  title="FunctionGemma CPU Fixed"
47
  )
 
13
  token=hf_token
14
  )
15
 
16
+ def process_request(user_prompt, developer_prompt, tools_json):
17
  try:
18
  tools = json.loads(tools_json) if tools_json.strip() else []
19
 
20
  # FunctionGemma format
21
  messages = [
22
+ {"role": "developer", "content": developer_prompt},
23
  {"role": "user", "content": user_prompt}
24
  ]
25
 
 
41
 
42
  demo = gr.Interface(
43
  fn=process_request,
44
+ inputs=[gr.Textbox(label="User Prompt"), gr.Textbox(label="Developer Prompt"), gr.Textbox(label="Tools (JSON Array)")],
45
  outputs=gr.Code(label="Model Output"),
46
  title="FunctionGemma CPU Fixed"
47
  )