MCPcopy Index your code
hub / github.com/InternLM/InternLM / process_generation_to_code

Method process_generation_to_code

tools/pal_inference.py:167–173  ·  view source on GitHub ↗
(self, gens: str)

Source from the content-addressed store, hash-verified

165 return code
166
167 def process_generation_to_code(self, gens: str):
168 if "```python" in gens:
169 gens = gens.split("```python")[1].split("```")[0]
170 elif "```" in gens:
171 gens = gens.split("```")[1].split("```")[0]
172 code = gens.split("\n")
173 return code
174
175 def run(self, prompt, time_out: float = 100):
176 code = self.generate(prompt)

Callers 1

generateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected