MCPcopy
hub / github.com/OpenMotionLab/MotionGPT / add_text

Function add_text

app.py:176–195  ·  view source on GitHub ↗
(history, text, motion_uploaded, data_stored, method)

Source from the content-addressed store, hash-verified

174
175
176def add_text(history, text, motion_uploaded, data_stored, method):
177 data_stored = data_stored + [{'user_input': text}]
178
179 if 'file' in motion_uploaded.keys():
180 text = Text_Components.format(msg=text)
181 motion_uploaded = load_motion(motion_uploaded, method)
182 output_mp4_path = motion_uploaded['motion_video']
183 video_fname = motion_uploaded['motion_video_fname']
184 output_npy_path = motion_uploaded['motion_joints']
185 joints_fname = motion_uploaded['motion_joints_fname']
186
187 text = text + Video_Components.format(video_path=output_mp4_path,
188 video_fname=video_fname,
189 motion_path=output_npy_path,
190 motion_fname=joints_fname)
191 else:
192 text = f"""<h3>{text}</h3>"""
193 history = history + [(text, None)]
194 return history, gr.update(value="",
195 interactive=False), motion_uploaded, data_stored
196
197
198def add_audio(history, audio_path, data_stored):

Callers

nothing calls this directly

Calls 3

load_motionFunction · 0.85
keysMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected