Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -40,7 +40,15 @@ if __name__ == '__main__':
|
|
40 |
rerank_model_name_or_path=args.rerank_model_name,
|
41 |
)
|
42 |
logger.info(f"chatpdf model: {model}")
|
43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
# Funci贸n para generar respuesta (sin yield)
|
45 |
def predict(message, history):
|
46 |
history_format = []
|
|
|
40 |
rerank_model_name_or_path=args.rerank_model_name,
|
41 |
)
|
42 |
logger.info(f"chatpdf model: {model}")
|
43 |
+
|
44 |
+
def predict_stream(message, history):
|
45 |
+
history_format = []
|
46 |
+
for human, assistant in history:
|
47 |
+
history_format.append([human, assistant])
|
48 |
+
model.history = history_format
|
49 |
+
for chunk in model.predict_stream(message):
|
50 |
+
yield chunk
|
51 |
+
|
52 |
# Funci贸n para generar respuesta (sin yield)
|
53 |
def predict(message, history):
|
54 |
history_format = []
|