Skip to content

Change in Code Structure for better management and error handling#940

Open
Aksh8t wants to merge 2 commits intoQwenLM:mainfrom
Aksh8t:main
Open

Change in Code Structure for better management and error handling#940
Aksh8t wants to merge 2 commits intoQwenLM:mainfrom
Aksh8t:main

Conversation

@Aksh8t
Copy link
Copy Markdown

@Aksh8t Aksh8t commented Sep 22, 2024

Key Changes :

Encapsulation in QwenChatDemo Class: Most of the logic is encapsulated in the QwenChatDemo class. This allows easy testing, better organization, and clearer state management.

Clearer Separation of Concerns: The code is cleaner with input handling, chat logic, and command execution separated.

Error Handling: Improved error handling for user inputs and commands, ensuring the application handles edge cases better.

Code Readability: Functions are more modular, each handling a specific task (such as command handling or model loading).

Extensibility: By encapsulating the functionality into a class, you can more easily extend or modify features in the future (e.g., adding more commands or model configurations).

Change in Code Structure for better management and error handling
@jklj077 jklj077 requested a review from fyabc September 23, 2024 07:15
Comment thread cli_demo.py
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, TextIteratorStreamer
from transformers.trainer_utils import set_seed

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hello

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants