Skip to content

Revert chatqna async and enhance tests #1598

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ChatQnA/chatqna.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,10 @@ def align_outputs(self, data, cur_node, inputs, runtime_graph, llm_parameters_di
return next_data


async def align_generator(self, gen, **kwargs):
def align_generator(self, gen, **kwargs):
# OpenAI response format
# b'data:{"id":"","object":"text_completion","created":1725530204,"model":"meta-llama/Meta-Llama-3-8B-Instruct","system_fingerprint":"2.0.1-native","choices":[{"index":0,"delta":{"role":"assistant","content":"?"},"logprobs":null,"finish_reason":null}]}\n\n'
async for line in gen:
for line in gen:
line = line.decode("utf-8")
start = line.find("{")
end = line.rfind("}") + 1
Expand Down
2 changes: 1 addition & 1 deletion ChatQnA/tests/test_compose_on_gaudi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function validate_megaservice() {
# Curl the Mega Service
validate_service \
"${ip_address}:8888/v1/chatqna" \
"data:" \
"Nike" \
"mega-chatqna" \
"chatqna-gaudi-backend-server" \
'{"messages": "What is the revenue of Nike in 2023?"}'
Expand Down
6 changes: 3 additions & 3 deletions ChatQnA/tests/test_compose_on_rocm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ function validate_megaservice() {
# Curl the Mega Service
validate_service \
"${ip_address}:8888/v1/chatqna" \
"data: " \
"Nike" \
"chatqna-megaservice" \
"chatqna-backend-server" \
'{"messages": "What is the revenue of Nike in 2023?"}'
Expand Down Expand Up @@ -263,8 +263,8 @@ function main() {
echo "==== microservices validated ===="
validate_megaservice
echo "==== megaservice validated ===="
validate_frontend
echo "==== frontend validated ===="
# validate_frontend
# echo "==== frontend validated ===="

stop_docker
echo y | docker system prune
Expand Down
3 changes: 2 additions & 1 deletion ChatQnA/tests/test_compose_on_xeon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ function validate_service() {

function validate_microservices() {
# Check if the microservices are running correctly.
sleep 10m

# tei for embedding service
validate_service \
Expand Down Expand Up @@ -142,7 +143,7 @@ function validate_megaservice() {
# Curl the Mega Service
validate_service \
"${ip_address}:8888/v1/chatqna" \
"data" \
"Nike" \
"mega-chatqna" \
"chatqna-xeon-backend-server" \
'{"messages": "What is the revenue of Nike in 2023?"}'
Expand Down