dai commited on
Commit
0f7319f
2 Parent(s): 074c4ae 50f271e

Merge remote-tracking branch 'my-hf/main'

Browse files
Files changed (5) hide show
  1. README.md +5 -4
  2. app.py +0 -1
  3. lmp.py +0 -2
  4. md_logger.py +1 -1
  5. requirements.txt +5 -1
README.md CHANGED
@@ -8,6 +8,7 @@ sdk_version: 3.3.1
8
  app_file: app.py
9
  pinned: false
10
  license: apache-2.0
 
11
  ---
12
 
13
  # Code as Policies Tabletop Manipulation Interactive Demo
@@ -20,12 +21,12 @@ Below is an interactive demo for the simulated tabletop manipulation domain, see
20
 
21
  ## Preparations
22
  1. Obtain an [OpenAI API Key](https://openai.com/blog/openai-api/)
23
- 2. Gain Codex access by [joining the waitlist](https://openai.com/blog/openai-codex/)
24
 
25
  Once you have Codex access you can use code-davinci-002. Using the GPT-3 model (text-dainvci-002) is also ok, but performance won't be as good (there will be more code logic errors).
26
 
27
- ## Usage
28
- 1. Fill in the API Key, model name, and how many blocks and bowls to be spawned in the environment.
29
  2. Click Setup/Reset Simulation
30
  3. Based on the new randomly sampled object names, input an instruction and click Run Instruction. If successful, this will render a video and update the simulation environment visualization.
31
 
@@ -38,7 +39,7 @@ You can run instructions in sequence and refer back to previous instructions (e.
38
  * Language-based reasoning (e.g. put the forest-colored block on the ocean-colored bowl).
39
  * Simple Q&A (e.g. how many blocks are to the left of the blue bowl?)
40
 
41
- ## Example Instructions
42
  Note object names may need to be changed depending the sampled object names.
43
  * put the sun-colored block on the bowl closest to it
44
  * stack the blocks on the bottom most bowl
 
8
  app_file: app.py
9
  pinned: false
10
  license: apache-2.0
11
+ duplicated_from: jackyliang42/code-as-policies
12
  ---
13
 
14
  # Code as Policies Tabletop Manipulation Interactive Demo
 
21
 
22
  ## Preparations
23
  1. Obtain an [OpenAI API Key](https://openai.com/blog/openai-api/)
24
+ 2. Gain Codex access by [joining the waitlist](https://openai.com/blog/openai-codex/)
25
 
26
  Once you have Codex access you can use code-davinci-002. Using the GPT-3 model (text-dainvci-002) is also ok, but performance won't be as good (there will be more code logic errors).
27
 
28
+ ## Usage
29
+ 1. Fill in the API Key, model name, and how many blocks and bowls to be spawned in the environment.
30
  2. Click Setup/Reset Simulation
31
  3. Based on the new randomly sampled object names, input an instruction and click Run Instruction. If successful, this will render a video and update the simulation environment visualization.
32
 
 
39
  * Language-based reasoning (e.g. put the forest-colored block on the ocean-colored bowl).
40
  * Simple Q&A (e.g. how many blocks are to the left of the blue bowl?)
41
 
42
+ ## Example Instructions
43
  Note object names may need to be changed depending the sampled object names.
44
  * put the sun-colored block on the bowl closest to it
45
  * stack the blocks on the bottom most bowl
app.py CHANGED
@@ -123,7 +123,6 @@ class DemoRunner:
123
  def setup(api_key, model_name, n_blocks, n_bowls):
124
  if not api_key:
125
  return 'Please enter your OpenAI API key!', None, None
126
-
127
  if n_blocks + n_bowls == 0:
128
  return 'Please select at least one object!', None, None
129
 
 
123
  def setup(api_key, model_name, n_blocks, n_bowls):
124
  if not api_key:
125
  return 'Please enter your OpenAI API key!', None, None
 
126
  if n_blocks + n_bowls == 0:
127
  return 'Please select at least one object!', None, None
128
 
lmp.py CHANGED
@@ -141,7 +141,6 @@ class LMPFGen:
141
  other_vars = {}
142
  gvars = merge_dicts([self._fixed_vars, self._variable_vars, other_vars])
143
  lvars = {}
144
-
145
  exec_safe(f_src, gvars, lvars)
146
 
147
  f = lvars[f_name]
@@ -245,7 +244,6 @@ def exec_safe(code_str, gvars=None, lvars=None):
245
  banned_phrases = ['import', '__']
246
  for phrase in banned_phrases:
247
  assert phrase not in code_str
248
-
249
  if gvars is None:
250
  gvars = {}
251
  if lvars is None:
 
141
  other_vars = {}
142
  gvars = merge_dicts([self._fixed_vars, self._variable_vars, other_vars])
143
  lvars = {}
 
144
  exec_safe(f_src, gvars, lvars)
145
 
146
  f = lvars[f_name]
 
244
  banned_phrases = ['import', '__']
245
  for phrase in banned_phrases:
246
  assert phrase not in code_str
 
247
  if gvars is None:
248
  gvars = {}
249
  if lvars is None:
md_logger.py CHANGED
@@ -22,4 +22,4 @@ class MarkdownLogger:
22
  def get_messages(self):
23
  m = self._messages
24
  self._messages = []
25
- return m
 
22
  def get_messages(self):
23
  m = self._messages
24
  self._messages = []
25
+ return m
requirements.txt CHANGED
@@ -8,5 +8,9 @@ pybullet
8
  imageio==2.4.1
9
  imageio-ffmpeg
10
  moviepy
 
11
  omegaconf
12
- gradio
 
 
 
 
8
  imageio==2.4.1
9
  imageio-ffmpeg
10
  moviepy
11
+ <<<<<<< HEAD
12
  omegaconf
13
+ gradio
14
+ =======
15
+ omegaconf
16
+ >>>>>>> my-hf/main