sohojoe commited on
Commit
6616951
·
1 Parent(s): b6ba8eb

show the raw json

Browse files
Files changed (1) hide show
  1. charles_actor.py +3 -2
charles_actor.py CHANGED
@@ -83,6 +83,7 @@ class CharlesActor:
83
 
84
  if speaker_finished and len(prompt) > 0:
85
  print(f"Prompt: {prompt}")
 
86
  system_one_audio_history.append(prompt)
87
  if len(system_one_audio_history) > 10:
88
  system_one_audio_history = system_one_audio_history[-10:]
@@ -90,6 +91,8 @@ class CharlesActor:
90
  table_content += "\n".join([f"| {item} |" for item in reversed(system_one_audio_history)])
91
  self._system_one_audio_history_output = table_content
92
  await self._respond_to_prompt_actor.enqueue_prompt.remote(prompt)
 
 
93
 
94
  video_frames = await self._streamlit_av_queue.get_video_frames_async()
95
  if len(video_frames) > 0:
@@ -98,9 +101,7 @@ class CharlesActor:
98
  skipped_video_frames += (len(video_frames) -1)
99
  image_as_array = video_frames[-1]
100
  image_vector = self._clip_transform.image_to_embeddings(image_as_array)
101
- # image_vector = image_vector.unsqueeze(0)
102
  image_vector = image_vector[0]
103
- print(f"image_vector.shape: {image_vector.shape}")
104
  distances, closest_item_key, distance_debug_str = self._prototypes.get_distances(image_vector)
105
  vector_debug = f"{closest_item_key} {distance_debug_str}"
106
 
 
83
 
84
  if speaker_finished and len(prompt) > 0:
85
  print(f"Prompt: {prompt}")
86
+ system_one_audio_history.append("... " + str(raw_json))
87
  system_one_audio_history.append(prompt)
88
  if len(system_one_audio_history) > 10:
89
  system_one_audio_history = system_one_audio_history[-10:]
 
91
  table_content += "\n".join([f"| {item} |" for item in reversed(system_one_audio_history)])
92
  self._system_one_audio_history_output = table_content
93
  await self._respond_to_prompt_actor.enqueue_prompt.remote(prompt)
94
+ # else:
95
+ # print(f"not ready... " + str(raw_json))
96
 
97
  video_frames = await self._streamlit_av_queue.get_video_frames_async()
98
  if len(video_frames) > 0:
 
101
  skipped_video_frames += (len(video_frames) -1)
102
  image_as_array = video_frames[-1]
103
  image_vector = self._clip_transform.image_to_embeddings(image_as_array)
 
104
  image_vector = image_vector[0]
 
105
  distances, closest_item_key, distance_debug_str = self._prototypes.get_distances(image_vector)
106
  vector_debug = f"{closest_item_key} {distance_debug_str}"
107