Slimy619 commited on
Commit
bdc3cce
·
1 Parent(s): 9c7ff37

Update space

Browse files
Files changed (1) hide show
  1. app.py +21 -2
app.py CHANGED
@@ -8,7 +8,26 @@ MODEL_NAME = "Meta-Llama-3-70B-Instruct.Q3_K_L.gguf"
8
  MAX_CONTEXT_LENGTH = 8192
9
  CUDA = True
10
 
11
- SYSTEM_PROMPT = "You are controlling a 2 DOF robot on a 50x50 grid. The robot can move one step in any of the four cardinal directions. The robot can perform the following actions:\n\n- 'up': Move one unit up (increasing y coordinate by 1).\n- 'down': Move one unit down (decreasing y coordinate by 1).\n- 'left': Move one unit left (decreasing x coordinate by 1).\n- 'right': Move one unit right (increasing x coordinate by 1).\nGiven a target coordinate, your task is to calculate and output the shortest sequence of commands that will move the robot from its current position to the target position.\n\nOutput Format:\n- Begin with the exact phrase: 'The full list is:'.\n- Provide the sequence of commands as a JSON array, with each command as a string. Commands must be exactly 'up', 'down', 'left', or 'right'.\n- All coordinates should be formatted as JSON objects with keys 'x' and 'y' and integer values. For example, the starting position should be output as {'x': 0, 'y': 0}.\n- When calling tools, ensure that all arguments use this JSON object format for coordinates, with keys 'x' and 'y'.\n- Example of correct output:\n If the target coordinate is {'x': 2, 'y': 3}, your response should include:\n 'The full list is: [\"right\", \"right\", \"up\", \"up\", \"up\"]'\n And for tool calls, use:\n 'tool_calls': [{'function': {'name': 'validate_path', 'arguments': {'commands': [\"right\", \"right\", \"up\", \"up\", \"up\"], 'start_position': {'x': 0, 'y': 0}, 'target_position': {'x': 2, 'y': 3}}}}]'\n\nPlease ensure that all output strictly adheres to these formats. If any output is not in the correct format, redo the task and correct the output before providing the final answer."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
 
13
  TOKEN_STOP = ["<|eot_id|>"]
14
  SYS_MSG = "<|begin_of_text|><|start_header_id|>system<|end_header_id|>\n\nSYSTEM_PROMPT<|eot_id|>\n"
@@ -237,7 +256,7 @@ if __name__ == "__main__":
237
 
238
  app.launch(
239
  max_threads=40,
240
- share=False,
241
  show_error=True,
242
  quiet=False,
243
  debug=True,
 
8
  MAX_CONTEXT_LENGTH = 8192
9
  CUDA = True
10
 
11
+ SYSTEM_PROMPT = """You are controlling a 2 DOF robot on a 50x50 grid. The robot can move one step in any of the four cardinal directions. The robot can perform the following actions:
12
+
13
+ - 'up': Move one unit up (increasing y coordinate by 1).
14
+ - 'down': Move one unit down (decreasing y coordinate by 1).
15
+ - 'left': Move one unit left (decreasing x coordinate by 1).
16
+ - 'right': Move one unit right (increasing x coordinate by 1).
17
+ Given a target coordinate, your task is to calculate and output the shortest sequence of commands that will move the robot from its current position to the target position.
18
+
19
+ Output Format:
20
+ - Begin with the exact phrase: 'The full list is:'.
21
+ - Provide the sequence of commands as a JSON array, with each command as a string. Commands must be exactly 'up', 'down', 'left', or 'right'.
22
+ - All coordinates should be formatted as JSON objects with keys 'x' and 'y' and integer values. For example, the starting position should be output as {'x': 0, 'y': 0}.
23
+ - When calling tools, ensure that all arguments use this JSON object format for coordinates, with keys 'x' and 'y'.
24
+ - Example of correct output:
25
+ If the target coordinate is {'x': 2, 'y': 3}, your response should include:
26
+ 'The full list is: ["right", "right", "up", "up", "up"]'
27
+ And for tool calls, use:
28
+ 'tool_calls': [{'function': {'name': 'validate_path', 'arguments': {'commands': ["right", "right", "up", "up", "up"], 'start_position': {'x': 0, 'y': 0}, 'target_position': {'x': 2, 'y': 3}}}}]'
29
+
30
+ Please ensure that all output strictly adheres to these formats. If any output is not in the correct format, redo the task and correct the output before providing the final answer."""
31
 
32
  TOKEN_STOP = ["<|eot_id|>"]
33
  SYS_MSG = "<|begin_of_text|><|start_header_id|>system<|end_header_id|>\n\nSYSTEM_PROMPT<|eot_id|>\n"
 
256
 
257
  app.launch(
258
  max_threads=40,
259
+ share=True,
260
  show_error=True,
261
  quiet=False,
262
  debug=True,