Spaces:
Running
Running
优化输入文本打印逻辑,限制输出长度以提高可读性
Browse files
app.py
CHANGED
@@ -52,7 +52,7 @@ async def predict(request: PredictRequest):
|
|
52 |
try:
|
53 |
input_text = request.text # FastAPI 会自动解析为 PredictRequest 对象
|
54 |
affected_stock_codes = request.stock_codes
|
55 |
-
print("Input text:", input_text)
|
56 |
print("Affected stock codes:", affected_stock_codes)
|
57 |
return predict(input_text, affected_stock_codes)
|
58 |
except Exception as e:
|
|
|
52 |
try:
|
53 |
input_text = request.text # FastAPI 会自动解析为 PredictRequest 对象
|
54 |
affected_stock_codes = request.stock_codes
|
55 |
+
print("Input text:", input_text[:200] if len(input_text) > 200 else input_text)
|
56 |
print("Affected stock codes:", affected_stock_codes)
|
57 |
return predict(input_text, affected_stock_codes)
|
58 |
except Exception as e:
|