Add debug info
Browse files
app.py
CHANGED
@@ -227,7 +227,7 @@ def infer_chatts_stream(prompt: str, csv_file, use_default):
|
|
227 |
|
228 |
full_prompt = f"<|im_start|>system\nYou are a helpful assistant. Your name is ChatTS. You can analyze time series data and provide insights. If user asks who you are, you should give your name and capabilities in the language of the prompt. If no time series are provided, you should say 'I cannot answer this question as you haven't provide the timeseries I need' in the language of the prompt. Always check if the user has provided time series data before answering.<|im_end|><|im_start|>user\n{prefix}{clean_prompt}<|im_end|><|im_start|>assistant\n"
|
229 |
|
230 |
-
print(f"[debug] {len(ts_list)=}, {[len(item) for item in ts_list]=}")
|
231 |
|
232 |
# Encode inputs
|
233 |
inputs = processor(
|
@@ -238,6 +238,9 @@ def infer_chatts_stream(prompt: str, csv_file, use_default):
|
|
238 |
)
|
239 |
inputs = {k: v.to(model.device) for k, v in inputs.items()}
|
240 |
|
|
|
|
|
|
|
241 |
# Generate with streaming
|
242 |
streamer = TextIteratorStreamer(tokenizer, timeout=10., skip_prompt=True, skip_special_tokens=True)
|
243 |
inputs.update({
|
|
|
227 |
|
228 |
full_prompt = f"<|im_start|>system\nYou are a helpful assistant. Your name is ChatTS. You can analyze time series data and provide insights. If user asks who you are, you should give your name and capabilities in the language of the prompt. If no time series are provided, you should say 'I cannot answer this question as you haven't provide the timeseries I need' in the language of the prompt. Always check if the user has provided time series data before answering.<|im_end|><|im_start|>user\n{prefix}{clean_prompt}<|im_end|><|im_start|>assistant\n"
|
229 |
|
230 |
+
print(f"[debug] {full_prompt}. {len(ts_list)=}, {[len(item) for item in ts_list]=}")
|
231 |
|
232 |
# Encode inputs
|
233 |
inputs = processor(
|
|
|
238 |
)
|
239 |
inputs = {k: v.to(model.device) for k, v in inputs.items()}
|
240 |
|
241 |
+
if inputs['timeseries'] is not None:
|
242 |
+
print(f"[debug] {inputs['timeseries'].shape=}")
|
243 |
+
|
244 |
# Generate with streaming
|
245 |
streamer = TextIteratorStreamer(tokenizer, timeout=10., skip_prompt=True, skip_special_tokens=True)
|
246 |
inputs.update({
|