Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -31,7 +31,7 @@ row_texts = df.apply(lambda row: " | ".join(row.astype(str)), axis=1)
|
|
31 |
row_embeddings = embedding_model.encode(row_texts.tolist(), convert_to_tensor=True)
|
32 |
|
33 |
# Load mô hình Qwen và tokenizer cho việc tạo phản hồi
|
34 |
-
fc_model = AutoModelForCausalLM.from_pretrained('Qwen/Qwen2.5-3B-Instruct', torch_dtype=torch.float16
|
35 |
fc_tokenizer = AutoTokenizer.from_pretrained('Qwen/Qwen2.5-3B-Instruct')
|
36 |
|
37 |
# --------------------------
|
@@ -108,7 +108,7 @@ Bạn đã sẵn sàng phân tích và đưa ra báo cáo!
|
|
108 |
]
|
109 |
|
110 |
response_template = fc_tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
111 |
-
response_inputs = fc_tokenizer(response_template, return_tensors="pt")
|
112 |
|
113 |
# Dùng TextIteratorStreamer để stream phản hồi
|
114 |
streamer = TextIteratorStreamer(fc_tokenizer, skip_prompt=True, skip_special_tokens=True)
|
|
|
31 |
row_embeddings = embedding_model.encode(row_texts.tolist(), convert_to_tensor=True)
|
32 |
|
33 |
# Load mô hình Qwen và tokenizer cho việc tạo phản hồi
|
34 |
+
fc_model = AutoModelForCausalLM.from_pretrained('Qwen/Qwen2.5-3B-Instruct', torch_dtype=torch.float16)
|
35 |
fc_tokenizer = AutoTokenizer.from_pretrained('Qwen/Qwen2.5-3B-Instruct')
|
36 |
|
37 |
# --------------------------
|
|
|
108 |
]
|
109 |
|
110 |
response_template = fc_tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
111 |
+
response_inputs = fc_tokenizer(response_template, return_tensors="pt")
|
112 |
|
113 |
# Dùng TextIteratorStreamer để stream phản hồi
|
114 |
streamer = TextIteratorStreamer(fc_tokenizer, skip_prompt=True, skip_special_tokens=True)
|