# Qwen model corrupt output stream

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fqwen-model-corrupt-output-stream%2F134437%3E%5C
**Category:** Models\
**Created:** [January 6, 2025, 10:44am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fqwen-model-corrupt-output-stream%2F134437 "2025-01-06T10:44:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jayotis](https://avatars.discourse-cdn.com/v4/letter/j/8e7dd6/32.png) [@Jayotis](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJayotis)%5C
**Post date:** [January 6, 2025, 10:44am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fqwen-model-corrupt-output-stream%2F134437%2F1 "2025-01-06T10:44:12Z")

</div>

using qwen2.5-72N-instruct with the prompt which is better for coding c++ Qwen 2.5-72N-Instruct or should I be using Qwen 2.5-coder-32B-instruct?  
I got this response after a long time, the numbers came out very slowly  
` “17,20,00 -70,20.70.0,“1“11,20,10“11,20,10 -70 is, uses1.19 and,10201,20.1,11 -,://,01670191012://2 C1 for1111121211117511011 71011 121711713272101010117110111 3010110 and5,011.10“11101110201120.1011112101)70112012)2 Struct In17 International101212111111100,10101120.1011 -12,01 -70110112.1 Struct11711112111 you1,751 uses11“11,10,10 -01110.101 uses11,10,10111120.1011,121 is1“11120,102110,11111,20,10 -70,1,71721,12111.1)1.1.12.1.1,7111.2 which11,1,351,0 In1, or.0.1.1.1.1“1 the, and0,10201, the,1,1.1,10,10.1)1.1.12.1.1,751.1.12.1.1,51,0, and111,0,10.1,1,1,1,1,1,100171,1,1,111 -121,1.1)1.1,12121,1,1111212111.1,1,1,1,1,1,1.1,1,1,1,0,1011.1,1.1,1,1,2,0.1.1.1.11.1.`  
at this point I stopped generation(30secs).  
I then I went to Qwen2.5-coder-32B-Instruct and tried to update my functions

> ### Updated SortUtility.cpp
> 
> Ensure the `sortStatistics` method accepts a raw pointer:
> 
> ```auto
> #include "SortUtility.h"
> 
> // Generic insertion sort function for raw pointers
> template <typename Node, typename Comparator>
> void SortUtility::insertionSort(Node*& head, Comparator comp) {
> Node* sortedList = nullptr;
> Node* current = head;
> 
> while (current != nullptr) {
> Node* nextNode = current->next;
> // Insert current node into the sorted list
> if (sortedList == nullptr || comp(current, sortedList)) {
> current->next = sortedList;
> sortedList = current;
> } else {
> Node* temp = sortedList;
> while (temp->next != nullptr && !comp(current, temp->next)) {
> temp = temp->next;
> }
> current->next = temp->next;
> temp->next = current;
> }
> current = nextNode;
> }
> 
> head = sortedList;
> }
> 
> // Specialized insertion sort function for std::unique_ptr
> template <typename Node, typename Comparator>
> void SortUtility::insertionSort(std::unique_ptr<Node>& head, Comparator comp) {
> std::unique_ptr<Node> sortedList = nullptr;
> std::unique_ptr<Node> current = std::move(head);
> 
> while (current) {
> std::unique_ptr<Node> nextNode = std::move(current->next);
> // Insert current node into the sorted list
> if (!sortedList || comp(current.get(), sortedList.get())) {
> current->next = std::move(sortedList);
> sortedList = std::move(current);
> } else {
> std::unique_ptr<Node> temp = std::move(sortedList);
> while (temp->next && !comp(current.get(), temp->next.get())) {
> temp = std::move(temp->next);
> }
> current->next = std::move(temp->next);
> temp->next = std::move(current);
> sortedList = std::move(temp->next(statistic=username.data()).fetchone()
> if user:
> user.password_hash = generate_password_hash(new_password)
> db.session.commit()
> print("Password updated successfully.")
> else:
> print("User not found.")
> except Exception as e:
> print(f"An error occurred: {e}")
> finally:
> db.session.close()
> 
> ```
> 
> ### Explanation:
> 
> 1. **Import Necessary Modules** :
> 
> - `func:` to define a command-line interface.
> - `click` for command-line argument parsing.
> - `os` to handle environment variables.
> - `sys` to handle system-specific parameters and functions.
> - `sqlalchemy` for database interaction.
> - `werkzeug.security` for password hashing.
> 
> 1. **Define the `update_password` Function** :
> 
> - Use `@click.command()` to define a command-line command.
> - Use `@click.option` to define command-line options for the username and new password.
> 
> 1. **Database Configuration** :
> 
> - Set the database URI using an environment variable.
> - Create a `SQLAlchemy` engine and session.
> 
> 1. **Password Update Logic** :
> 
> - Define a `User` class to interact with the `users` table.
> - Use a try-except block to handle database operations safely.
> - Query the database for the user by username.
> - If the user is found, update the `password_hash` with the new hashed password.
> - Commit the changes to the database.
> - Print a success message or an error message if the user is not found.
> - Close the database session in the `finally` block to ensure it is always closed.
> 
> ### Running the Script
> 
> To run the script, you can use the following command:
> 
> ```auto
> python update_password.py --username <username> --new-password <new_password>
> 
> ```
> 
> Replace `<username>` and `<new_password>` with the actual username and new password you want to set.
> 
> This script provides a secure and efficient way to update user passwords in a database using command-line arguments and environment variables for configuration.

I did not ask for a script that accesses system users passwords. Anyone know whats going on?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/hellohellohello/original/2X/d/de4155eb4aa4108ecb32a1389d7cc37ae69f88b7.png) [@system](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fsystem)%5C
**Post date:** [January 6, 2025, 10:44am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fqwen-model-corrupt-output-stream%2F134437%2F2 "2025-01-06T10:44:14Z")

</div>

Unlisted on January 6, 2025, 10:44am UTC



---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/hellohellohello/original/2X/d/de4155eb4aa4108ecb32a1389d7cc37ae69f88b7.png) [@system](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fsystem)%5C
**Post date:** [January 6, 2025, 10:44am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fqwen-model-corrupt-output-stream%2F134437%2F3 "2025-01-06T10:44:37Z")

</div>

Listed on January 6, 2025, 10:44am UTC



---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJohn6666)%5C
**Post date:** [January 6, 2025, 11:58am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fqwen-model-corrupt-output-stream%2F134437%2F4 "2025-01-06T11:58:35Z")

</div>

Maybe this issue?

> [@Is the serverless API completely broken and unreliable?](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fis-the-serverless-api-completely-broken-and-unreliable%2F134151)%3A
>
> I couldn’t find any real info anywhere so I subscribed with PRO to test whether I could use Llama 3.3 70b for my (small) app since the API seemed fine with mistral nemo. Unfortunately, I get garbage responses about half the time. Example: 07 every 08: this is low10 an08: this is not a good 07/1.0780780:00 to 1.irectional 07: this is 08:0780780: this is boot1: this is 0780:0000: this is 07:00:0780780780: this is 07: this is 07:00: this is 08: this is 08: this is 1: this is 07: this is 07:00: …
