From 7ed7b3d893187f764f34b47750f3c9f12316fb9b Mon Sep 17 00:00:00 2001 From: Ignas Gustainis Date: Thu, 27 Jun 2024 01:19:51 +0300 Subject: [PATCH] feat: linting & ci (#35) --- .github/workflows/publish-ghcr.yml | 2 +- .pre-commit-config.yaml | 15 +++++++++++++++ .python-version | 2 +- Dockerfile | 2 +- Dockerfile-gpu | 2 +- README.md | 2 +- requirements.txt | 3 ++- src/.env | 2 +- src/data/dummy_data.jsonl | 2 +- src/start.sh | 4 ++-- src/validate.py | 22 ++++++++++++++-------- src/validation_config.json.example | 4 ++-- src/validation_config_cpu.json.example | 4 ++-- 13 files changed, 44 insertions(+), 22 deletions(-) create mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/publish-ghcr.yml b/.github/workflows/publish-ghcr.yml index f9751ab..f5fe093 100644 --- a/.github/workflows/publish-ghcr.yml +++ b/.github/workflows/publish-ghcr.yml @@ -3,7 +3,7 @@ name: Create and publish a Docker image on: workflow_dispatch: - + release: types: [published] diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..2fe4ab8 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,15 @@ +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.3.0 + hooks: + - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace +- repo: https://github.com/astral-sh/ruff-pre-commit + # Ruff version. + rev: v0.4.10 + hooks: + # Run the linter. + - id: ruff + # Run the formatter. + - id: ruff-format diff --git a/.python-version b/.python-version index 939821c..56d91d3 100644 --- a/.python-version +++ b/.python-version @@ -1 +1 @@ -3.10.12 \ No newline at end of file +3.10.12 diff --git a/Dockerfile b/Dockerfile index 8a29a23..f0dca25 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,4 +9,4 @@ RUN pip3 install -r requirements.txt WORKDIR /app/src -CMD ["sh", "-c", "bash start.sh --hf_token ${HF_TOKEN} --flock_api_key ${FLOCK_API_KEY} --task_id ${TASK_ID} --validation_args_file validation_config_cpu.json.example"] \ No newline at end of file +CMD ["sh", "-c", "bash start.sh --hf_token ${HF_TOKEN} --flock_api_key ${FLOCK_API_KEY} --task_id ${TASK_ID} --validation_args_file validation_config_cpu.json.example"] diff --git a/Dockerfile-gpu b/Dockerfile-gpu index 62e35f5..2f86dc6 100644 --- a/Dockerfile-gpu +++ b/Dockerfile-gpu @@ -17,4 +17,4 @@ WORKDIR /app/src ENV IS_DOCKER_CONTAINER=1 -CMD ["sh", "-c", "bash start.sh --hf_token ${HF_TOKEN} --flock_api_key ${FLOCK_API_KEY} --task_id ${TASK_ID} --validation_args_file validation_config.json.example"] \ No newline at end of file +CMD ["sh", "-c", "bash start.sh --hf_token ${HF_TOKEN} --flock_api_key ${FLOCK_API_KEY} --task_id ${TASK_ID} --validation_args_file validation_config.json.example"] diff --git a/README.md b/README.md index c139eee..2e672b6 100644 --- a/README.md +++ b/README.md @@ -67,4 +67,4 @@ bash start.sh \ --task_id your_task_id \ --validation_args_file validation_config.json.example \ --auto_clean_cache False -``` \ No newline at end of file +``` diff --git a/requirements.txt b/requirements.txt index 9c72cf6..53ca1b7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,4 +13,5 @@ transformers_stream_generator tenacity python-dotenv peft>=0.10.0 -gitpython \ No newline at end of file +gitpython +pre-commit diff --git a/src/.env b/src/.env index 71834d6..b928a09 100644 --- a/src/.env +++ b/src/.env @@ -1 +1 @@ -TIME_SLEEP=600 \ No newline at end of file +TIME_SLEEP=600 diff --git a/src/data/dummy_data.jsonl b/src/data/dummy_data.jsonl index 3ccc637..cb86d86 100644 --- a/src/data/dummy_data.jsonl +++ b/src/data/dummy_data.jsonl @@ -7,4 +7,4 @@ {"system": "You are a helpful assistant.", "conversations": [{"role": "user", "content": "What steps should I take to reduce taxes on my income?"}, {"role": "assistant", "content": "There are several steps you can take to reduce taxes on your income:\n\n1. Contribute to a retirement account: Contributions to a traditional IRA or a 401(k) can reduce your taxable income and save you money on taxes.\n\n2. Itemize your deductions: If you have significant expenses such as mortgage interest, medical expenses, or charitable contributions, itemizing your deductions may reduce your taxable income.\n\n3. Take advantage of tax credits: Tax credits, such as the Earned Income Tax Credit or the Child Tax Credit, can reduce your tax bill dollar for dollar.\n\n4. Invest in tax-free or tax-deferred accounts: Investments in tax-free or tax-deferred accounts such as municipal bonds, Roth IRAs, or 529 plans can reduce your taxable income.\n\n5. Consider income splitting: If you are married, consider splitting income with your spouse to reduce your overall tax bill.\n\nIt\u2019s important to consult with a tax professional or financial advisor to determine the best strategy for your specific situation."}, {"role": "user", "content": "Can you give me an example of a tax credit that can help reduce my taxes?"}, {"role": "assistant", "content": "Sure! One example of a tax credit that can help reduce your taxes is the Child Tax Credit. This is a credit of up to $2,000 per child under the age of 17 that can be claimed on your tax return. To qualify for the full credit, your income must be below a certain threshold (currently $400,000 for married filing jointly, or $200,000 for all other filers).\n\nIf your income is above the threshold, you may still be eligible for a partial credit. The credit is partially refundable, meaning that if the credit exceeds your tax liability, you may receive a refund for the difference up to $1,400 per child.\n\nTo claim the Child Tax Credit, you must have a qualifying child who meets certain criteria, such as being a U.S. citizen, living with you for more than half the year, and being related to you.\n\nIt\u2019s important to note that tax laws can change, so it\u2019s always a good idea to check with a tax professional or use tax preparation software to ensure you are claiming all the credits and deductions you are eligible for."}, {"role": "user", "content": "Can you explain the difference between a traditional IRA and a Roth IRA?"}, {"role": "assistant", "content": "Yes, I can explain the difference between a traditional IRA and a Roth IRA.\n\nA traditional IRA is a retirement account in which you can make pre-tax contributions, meaning you can deduct your contribution from your taxable income in the year you make it. The money in your traditional IRA grows tax-deferred, which means you won\u2019t pay taxes on the earnings until you withdraw the money in retirement. When you withdraw money from a traditional IRA, it is taxed as ordinary income.\n\nA Roth IRA, on the other hand, is a retirement account in which you make after-tax contributions, meaning you don\u2019t get a tax deduction for your contribution in the year you make it. However, the money in your Roth IRA grows tax-free, which means you won\u2019t pay taxes on the earnings when you withdraw the money in retirement. Additionally, qualified withdrawals from a Roth IRA are tax-free.\n\nThe difference between the two types of accounts is primarily when you pay taxes: with a traditional IRA, you pay taxes on the money when you withdraw it in retirement, while with a Roth IRA, you pay taxes on the money when you contribute to the account.\n\nIt\u2019s important to note that both types of accounts have contribution limits and other rules, so it\u2019s a good idea to consult with a financial advisor or tax professional to determine which type of account is best for your individual situation."}, {"role": "user", "content": "What is the contribution limit for a Roth IRA in 2021?"}, {"role": "assistant", "content": "The contribution limit for a Roth IRA in 2021 is $6,000 for individuals under age 50, and $7,000 for those age 50 and above. This means that you can contribute up to $6,000 or $7,000 (depending on your age) per year to your Roth IRA, as long as your income falls below certain limits.\n\nIt\u2019s important to note that contribution limits may change from year to year, so it\u2019s always a good idea to check the current year\u2019s limits before making any contributions. Additionally, there are income limits that determine whether you are eligible to contribute to a Roth IRA, and those limits can also change from year to year.\n\nIf you have any questions about Roth IRA contributions or eligibility, it\u2019s a good idea to consult with a financial advisor or tax professional."}, {"role": "user", "content": "Can you explain the difference between a 401(k) and an IRA?"}, {"role": "assistant", "content": "Yes, I can explain the difference between a 401(k) and an IRA.\n\nA 401(k) is an employer-sponsored retirement plan that allows employees to contribute a portion of their pre-tax salary to the plan. Employers may also offer matching contributions up to a certain amount. The money in a 401(k) grows tax-deferred, meaning you won\u2019t pay taxes on the earnings until you withdraw the money in retirement. Contributions to a 401(k) are subject to annual limits, which are set by the IRS.\n\nAn IRA, or individual retirement account, is a retirement account that you can set up on your own, outside of an employer-sponsored plan. IRAs come in two main types: traditional and Roth. A traditional IRA allows you to make pre-tax contributions, meaning you can deduct your contribution from your taxable income in the year you make it. The money in a traditional IRA grows tax-deferred, and you\u2019ll pay taxes on the money when you withdraw it in retirement. With a Roth IRA, you make after-tax contributions, meaning you don\u2019t get a tax deduction for your contribution in the year you make it. The money in a Roth IRA grows tax-free, and qualified withdrawals from a Roth IRA are tax-free.\n\nThe main difference between a 401(k) and an IRA is that a 401(k) is an employer-sponsored plan, while an IRA is an individual retirement account that you set up on your own. Additionally, 401(k) plans may have higher contribution limits than IRAs, and employers may offer matching contributions or other incentives to encourage employees to participate in the plan.\n\nIt\u2019s a good idea to consult with a financial advisor or tax professional to determine which type of account is best for your individual situation."}]} {"system": "You are a helpful assistant.", "conversations": [{"role": "user", "content": "What strategies should I use to focus better while studying?"}, {"role": "assistant", "content": "Here are some strategies that can help you focus better while studying:\n\n1. Create a conducive environment: Find a quiet, distraction-free location to study. Make sure the lighting is appropriate, and the temperature is comfortable.\n\n2. Set a study schedule: Create a study schedule that works for you and stick to it. This helps you stay focused and avoids procrastination.\n\n3. Take breaks: Taking short breaks between study sessions can help you stay focused and retain information better.\n\n4. Eliminate distractions: Turn off your phone, log out from social media, and avoid any other distractions that can prevent you from concentrating.\n\n5. Use active learning techniques: Use active learning techniques such as note-taking, summarizing, and teaching others to help you stay engaged.\n\n6. Stay motivated: Set goals for yourself and reward yourself when you achieve them. This can help you stay motivated and focused.\n\n7. Get enough sleep and exercise: A healthy lifestyle can help you stay alert and focused while studying. Make sure you get enough sleep and exercise regularly.\n\nRemember, every individual is different, and what works for one person may not work for another. Find what works best for you and stick to it."}, {"role": "user", "content": "Can you give me some examples of active learning techniques that I can use while studying?"}, {"role": "assistant", "content": "Sure! Here are some examples of active learning techniques that you can use while studying:\n\n1. Summarizing: Summarize the main ideas in your own words. This helps you retain the information better.\n\n2. Note-taking: Take notes while you\u2019re reading or listening to lectures. This helps you focus your attention and remember the key points.\n\n3. Teaching: Explain the concepts you\u2019ve learned to someone else. This helps you understand the material better and identify areas where you need further clarification.\n\n4. Practice questions: Complete practice questions or quizzes to test your understanding of the material.\n\n5. Mnemonics: Use mnemonics (memory aids) to help you remember important information. For example, using acronyms or visual associations.\n\n6. Group study: Study with a group of peers and share your knowledge with each other. This helps you learn from different perspectives and keeps you motivated.\n\n7. Mind mapping: Create visual diagrams or mind maps to organize information and understand the relationships between different concepts.\n\nRemember, using a combination of different active learning techniques can help you to better understand and retain information."}, {"role": "user", "content": "How can I incorporate active learning techniques while studying for math?"}, {"role": "assistant", "content": "Math is a subject that requires a lot of practice, so incorporating active learning techniques can be very helpful in mastering the concepts. Here are some ways you can use active learning techniques while studying for math:\n\n1. Practice problems: Math requires a lot of practice to master the concepts. Solve practice problems and work through examples to reinforce your understanding of the material.\n\n2. Explain concepts: Explain the math concepts you\u2019ve learned to someone else. This helps you solidify your understanding and identify areas where you need further clarification.\n\n3. Create flashcards: Create flashcards for formulas, equations, and definitions. Use them to quiz yourself and help you memorize the material.\n\n4. Write out explanations: Write out explanations of the steps you took to solve a problem. This helps you identify areas where you may have made mistakes and reinforce your understanding of the material.\n\n5. Work in groups: Study with a group of peers and work through problems together. This helps you learn from different perspectives and keeps you motivated.\n\n6. Use online resources: There are many online resources available for math, including interactive tutorials and videos. Use them to reinforce your understanding of the material.\n\nRemember, math can be challenging, but incorporating active learning techniques can help you to better understand and retain the material."}, {"role": "user", "content": "How can I manage my time effectively while studying for multiple exams?"}, {"role": "assistant", "content": "Managing your time effectively while studying for multiple exams can be challenging, but here are some tips that can help:\n\n1. Create a study schedule: Make a schedule that outlines your study sessions for each subject. Consider your other commitments and allocate sufficient time for each subject.\n\n2. Prioritize the most important exams: Determine which exams are the most important and allocate more study time to these subjects.\n\n3. Break down the material: Break down the material into smaller, manageable chunks. This makes it easier to study and makes the task less overwhelming.\n\n4. Use study aids: Use study aids such as flashcards or summary notes to help you study more efficiently.\n\n5. Avoid multitasking: Avoid multitasking and focus on one subject at a time. This helps you to concentrate better and retain information more effectively.\n\n6. Take breaks: Taking regular breaks between study sessions can help you to stay focused and avoid burnout.\n\n7. Review regularly: Regularly review your notes and study materials to reinforce your understanding of the material.\n\n8. Stay organized: Keep your study materials organized and easily accessible. This saves time and helps you to focus on studying rather than searching for materials.\n\nRemember, effective time management is crucial when studying for multiple exams. By creating a study schedule, breaking down the material, prioritizing tasks, and staying organized, you can manage your time effectively and achieve better results."}]} {"system": "You are a helpful assistant.", "conversations": [{"role": "user", "content": "How can I most efficiently manage my time?"}, {"role": "assistant", "content": "Here are some tips to manage your time more efficiently:\n\n1. Make a schedule: Create a schedule of your daily tasks and prioritize them based on importance.\n\n2. Use time blocks: Group similar tasks together and allocate specific time blocks for each task.\n\n3. Take breaks: Take short breaks in between tasks to help you stay focused and avoid burnout.\n\n4. Eliminate distractions: Remove any distractions that could interfere with your work, such as social media notifications or emails.\n\n5. Delegate tasks: If possible, delegate tasks to others to free up your time for more important tasks.\n\n6. Use technology: Use productivity apps or tools to help you manage your time, such as time-tracking apps, task management tools, or calendar apps.\n\n7. Be flexible: Be open to adjusting your schedule as needed and be willing to adapt to changes in your workload or priorities.\n\nRemember, effective time management requires discipline and practice, but by implementing these tips, you can increase your productivity and achieve your goals more efficiently."}, {"role": "user", "content": "Can you recommend any time-tracking apps?"}, {"role": "assistant", "content": "Sure, here are some popular time-tracking apps you can use:\n\n1. Toggl: Toggl is a simple and easy-to-use time-tracking app that allows you to track how much time you spend on each task or project.\n\n2. RescueTime: RescueTime is a time-tracking app that runs in the background and tracks how much time you spend on various websites and applications.\n\n3. Harvest: Harvest is a time-tracking app that also allows you to create and send invoices based on the time you've tracked.\n\n4. Clockify: Clockify is a free time-tracking app that lets you track time on multiple projects and tasks, and generate reports based on your time data.\n\n5. Timely: Timely is a time-tracking app that uses AI to automatically track your time and create a visual timeline of your workday.\n\n6. Everhour: Everhour is a time-tracking app that integrates with popular project management tools like Asana, Trello, and Basecamp.\n\nThese apps can help you track your time more accurately, improve your productivity, and help you stay on top of your work."}, {"role": "user", "content": "Can you explain how Clockify generates reports based on time data?"}, {"role": "assistant", "content": "Certainly! Clockify generates reports based on the time data you input into the app. Once you've tracked your time for different tasks or projects, you can generate reports that provide detailed insights into your work habits and productivity. Here are some of the features of Clockify's reporting system:\n\n1. Customizable reports: Clockify allows you to customize your reports based on a variety of criteria, such as date range, project, client, or task.\n\n2. Summary reports: Clockify can generate summary reports that provide an overview of your time data, including your total hours worked, billable hours, and non-billable hours.\n\n3. Detailed reports: You can also generate detailed reports that show a breakdown of your time data by day, week, month, or year.\n\n4. Exportable reports: Clockify allows you to export your reports in a variety of formats, including PDF, CSV, and Excel.\n\n5. Dashboard: Clockify has a dashboard that provides a real-time overview of your time data, including your current and upcoming tasks, as well as your progress towards your goals.\n\nOverall, Clockify's reporting system can provide valuable insights into your work habits and productivity, helping you make better decisions about how to manage your time and resources."}, {"role": "user", "content": "Can Clockify be integrated with other project management tools besides Asana, Trello, and Basecamp?"}, {"role": "assistant", "content": "Yes, Clockify can be integrated with other project management tools as well. In addition to Asana, Trello, and Basecamp, Clockify also integrates with many other popular project management tools, including:\n\n1. Jira: Jira is a popular project management tool used by many software development teams. With Clockify's Jira integration, you can track your time directly from Jira issues.\n\n2. ClickUp: ClickUp is a flexible task management tool that can be customized to fit any workflow. Clockify's ClickUp integration allows you to track time on individual tasks or projects.\n\n3. Monday.com: Monday.com is a visual project management tool that allows teams to collaborate and manage their work from a single platform. Clockify's Monday.com integration allows you to track time on tasks and projects directly from the Monday.com interface.\n\n4. Todoist: Todoist is a popular task management app that can be used to manage personal to-do lists or team projects. Clockify's Todoist integration allows you to track time on individual tasks or projects.\n\n5. MeisterTask: MeisterTask is a project management tool that allows teams to collaborate and manage their work from a single platform. Clockify's MeisterTask integration allows you to track time on individual tasks or projects directly from the MeisterTask interface.\n\nThere are many other project management tools that Clockify integrates with, so you can choose the one that works best for your team and your workflow."}]} -{"system": "You are a helpful assistant.", "conversations": [{"role": "user", "content": "What tips do you have for balancing work and home life?"}, {"role": "assistant", "content": "Here are a few tips for balancing work and home life:\n\n1. Set clear boundaries: Establish clear boundaries between work and home life. Try to stick to a regular work schedule and avoid working during your personal time.\n\n2. Prioritize your tasks: Prioritize your tasks to make sure you are accomplishing the most important things first. This can help you avoid wasting time on less important tasks and free up more time for your personal life.\n\n3. Take breaks: Taking regular breaks can help you stay focused and avoid burnout. Use your breaks to relax, exercise, or spend time with loved ones.\n\n4. Use technology to your advantage: Use technology to help you manage your work and personal life. For example, use a calendar app to schedule your work and personal commitments, or use a task management app to keep track of your to-do list.\n\n5. Learn to say no: Saying no to work commitments that don't align with your priorities can free up more time for your personal life.\n\nRemember that achieving a perfect balance between work and home life is not always possible. But by implementing these tips, you can create a healthy balance that works for you."}, {"role": "user", "content": "How can I develop better time management skills?"}, {"role": "assistant", "content": "Developing better time management skills can be challenging, but it is important for achieving your personal and professional goals. Here are some tips to help you improve your time management skills:\n\n1. Track your time: Start by tracking your time for a week or two to get a sense of how you are currently spending your time. This will help you identify any time-wasting activities and prioritize your tasks.\n\n2. Set goals: Set clear and specific goals for what you want to achieve in your personal and professional life. This will help you prioritize your tasks and stay focused on what really matters.\n\n3. Prioritize your tasks: Identify the most important tasks and prioritize them based on their urgency and importance. Use a to-do list or a task management app to keep track of your tasks.\n\n4. Use time management tools: There are many time management tools available, such as calendars, timers, and task lists. Use these tools to help you stay organized and on track.\n\n5. Learn to say no: Saying no to non-essential tasks or commitments can help you free up more time for the things that matter most.\n\n6. Take breaks: Taking regular breaks can help you stay focused and avoid burnout. Use your breaks to relax, exercise, or spend time with loved ones.\n\nRemember that developing better time management skills takes time and practice. Be patient with yourself and stay committed to your goals."}, {"role": "user", "content": "Can you recommend any particular time management tools that would be helpful?"}, {"role": "assistant", "content": "Sure! Here are some time management tools that you may find helpful:\n\n1. Calendar apps: Calendar apps like Google Calendar and Apple Calendar can help you schedule your appointments and tasks, set reminders, and keep track of your schedule.\n\n2. Task management apps: Task management apps like Trello, Asana, and Todoist can help you create to-do lists, set deadlines for your tasks, and prioritize your work.\n\n3. Pomodoro timers: Pomodoro timers like Focus@Will and Tomato Timer can help you stay focused by breaking your work into small, manageable chunks of time.\n\n4. Time-tracking apps: Time-tracking apps like RescueTime and Toggl can help you monitor how much time you spend on different tasks and activities, and identify areas where you can improve your productivity.\n\n5. Note-taking apps: Note-taking apps like Evernote and OneNote can help you jot down ideas, take notes during meetings, and keep track of important information.\n\n6. Distraction-blocker apps: Distraction-blocker apps like Freedom and Cold Turkey can help you stay focused by blocking distracting websites and apps during set times of day.\n\nRemember, the key to effective time management is finding a tool or set of tools that work best for you, and then using them consistently to help you stay focused and productive."}, {"role": "user", "content": "How can I improve my work efficiency?"}, {"role": "assistant", "content": "Improving your work efficiency can help you be more productive, complete your tasks more quickly, and reduce your stress levels. Here are some tips to help you improve your work efficiency:\n\n1. Set clear goals: Set clear and specific goals for what you want to achieve and break them down into smaller, actionable steps.\n\n2. Eliminate distractions: Eliminate distractions as much as possible by turning off notifications, closing unnecessary tabs or apps, and finding a quiet space to work.\n\n3. Prioritize your tasks: Identify the most important tasks and prioritize them based on their urgency and importance.\n\n4. Use time management tools: Use tools like calendars, timers, and task lists to help you stay organized and on track.\n\n5. Automate tasks: Automate tasks like email management and scheduling appointments to free up more time for important work.\n\n6. Delegate tasks: Delegate tasks where possible to colleagues or employees to help you focus on your most important responsibilities.\n\n7. Take breaks: Taking regular breaks can help you stay focused and avoid burnout. Use your breaks to relax, exercise, or spend time with loved ones.\n\nRemember, improving your work efficiency takes time and practice. Be patient with yourself and stay committed to your goals."}]} \ No newline at end of file +{"system": "You are a helpful assistant.", "conversations": [{"role": "user", "content": "What tips do you have for balancing work and home life?"}, {"role": "assistant", "content": "Here are a few tips for balancing work and home life:\n\n1. Set clear boundaries: Establish clear boundaries between work and home life. Try to stick to a regular work schedule and avoid working during your personal time.\n\n2. Prioritize your tasks: Prioritize your tasks to make sure you are accomplishing the most important things first. This can help you avoid wasting time on less important tasks and free up more time for your personal life.\n\n3. Take breaks: Taking regular breaks can help you stay focused and avoid burnout. Use your breaks to relax, exercise, or spend time with loved ones.\n\n4. Use technology to your advantage: Use technology to help you manage your work and personal life. For example, use a calendar app to schedule your work and personal commitments, or use a task management app to keep track of your to-do list.\n\n5. Learn to say no: Saying no to work commitments that don't align with your priorities can free up more time for your personal life.\n\nRemember that achieving a perfect balance between work and home life is not always possible. But by implementing these tips, you can create a healthy balance that works for you."}, {"role": "user", "content": "How can I develop better time management skills?"}, {"role": "assistant", "content": "Developing better time management skills can be challenging, but it is important for achieving your personal and professional goals. Here are some tips to help you improve your time management skills:\n\n1. Track your time: Start by tracking your time for a week or two to get a sense of how you are currently spending your time. This will help you identify any time-wasting activities and prioritize your tasks.\n\n2. Set goals: Set clear and specific goals for what you want to achieve in your personal and professional life. This will help you prioritize your tasks and stay focused on what really matters.\n\n3. Prioritize your tasks: Identify the most important tasks and prioritize them based on their urgency and importance. Use a to-do list or a task management app to keep track of your tasks.\n\n4. Use time management tools: There are many time management tools available, such as calendars, timers, and task lists. Use these tools to help you stay organized and on track.\n\n5. Learn to say no: Saying no to non-essential tasks or commitments can help you free up more time for the things that matter most.\n\n6. Take breaks: Taking regular breaks can help you stay focused and avoid burnout. Use your breaks to relax, exercise, or spend time with loved ones.\n\nRemember that developing better time management skills takes time and practice. Be patient with yourself and stay committed to your goals."}, {"role": "user", "content": "Can you recommend any particular time management tools that would be helpful?"}, {"role": "assistant", "content": "Sure! Here are some time management tools that you may find helpful:\n\n1. Calendar apps: Calendar apps like Google Calendar and Apple Calendar can help you schedule your appointments and tasks, set reminders, and keep track of your schedule.\n\n2. Task management apps: Task management apps like Trello, Asana, and Todoist can help you create to-do lists, set deadlines for your tasks, and prioritize your work.\n\n3. Pomodoro timers: Pomodoro timers like Focus@Will and Tomato Timer can help you stay focused by breaking your work into small, manageable chunks of time.\n\n4. Time-tracking apps: Time-tracking apps like RescueTime and Toggl can help you monitor how much time you spend on different tasks and activities, and identify areas where you can improve your productivity.\n\n5. Note-taking apps: Note-taking apps like Evernote and OneNote can help you jot down ideas, take notes during meetings, and keep track of important information.\n\n6. Distraction-blocker apps: Distraction-blocker apps like Freedom and Cold Turkey can help you stay focused by blocking distracting websites and apps during set times of day.\n\nRemember, the key to effective time management is finding a tool or set of tools that work best for you, and then using them consistently to help you stay focused and productive."}, {"role": "user", "content": "How can I improve my work efficiency?"}, {"role": "assistant", "content": "Improving your work efficiency can help you be more productive, complete your tasks more quickly, and reduce your stress levels. Here are some tips to help you improve your work efficiency:\n\n1. Set clear goals: Set clear and specific goals for what you want to achieve and break them down into smaller, actionable steps.\n\n2. Eliminate distractions: Eliminate distractions as much as possible by turning off notifications, closing unnecessary tabs or apps, and finding a quiet space to work.\n\n3. Prioritize your tasks: Identify the most important tasks and prioritize them based on their urgency and importance.\n\n4. Use time management tools: Use tools like calendars, timers, and task lists to help you stay organized and on track.\n\n5. Automate tasks: Automate tasks like email management and scheduling appointments to free up more time for important work.\n\n6. Delegate tasks: Delegate tasks where possible to colleagues or employees to help you focus on your most important responsibilities.\n\n7. Take breaks: Taking regular breaks can help you stay focused and avoid burnout. Use your breaks to relax, exercise, or spend time with loved ones.\n\nRemember, improving your work efficiency takes time and practice. Be patient with yourself and stay committed to your goals."}]} diff --git a/src/start.sh b/src/start.sh index c09af75..efb5124 100644 --- a/src/start.sh +++ b/src/start.sh @@ -12,7 +12,7 @@ while [[ "$#" -gt 0 ]]; do --flock_api_key) FLOCK_API_KEY="$2"; shift 2 ;; --task_id) TASK_ID="$2"; shift 2 ;; --validation_args_file) VALIDATION_ARGS_FILE="$2"; shift 2 ;; - *) + *) if [[ "$2" != --* ]]; then OTHER_ARGS+="$1 $2 "; shift 2 else @@ -40,4 +40,4 @@ while true; do exit $EXIT_CODE fi break -done \ No newline at end of file +done diff --git a/src/validate.py b/src/validate.py index 6bfff4d..eff4d1f 100644 --- a/src/validate.py +++ b/src/validate.py @@ -18,7 +18,6 @@ file_utils, ) -from pathlib import Path from dotenv import load_dotenv from pathlib import Path from core.collator import SFTDataCollator @@ -42,8 +41,8 @@ IS_DOCKER_CONTAINER = os.getenv("IS_DOCKER_CONTAINER", False) if not IS_DOCKER_CONTAINER: - import git # only import git in non-docker container environment because it is not installed in docker image - + import git # only import git in non-docker container environment because it is not installed in docker image + if HF_TOKEN is None: raise ValueError( "You need to set HF_TOKEN to download some gated model from HuggingFace" @@ -157,6 +156,7 @@ def load_model(model_name_or_path: str, val_args: TrainingArguments) -> Trainer: return model + def is_latest_version(repo_path: str): """ Check if the current branch is up-to-date with the remote main branch. @@ -168,11 +168,13 @@ def is_latest_version(repo_path: str): origin = repo.remotes.origin origin.fetch() - local_commit = repo.commit('main') - remote_commit = repo.commit('origin/main') + local_commit = repo.commit("main") + remote_commit = repo.commit("origin/main") if local_commit.hexsha != remote_commit.hexsha: - logger.error("The local code is not up to date with the main branch.Pls update your version") + logger.error( + "The local code is not up to date with the main branch.Pls update your version" + ) raise except git.exc.InvalidGitRepositoryError: logger.error("This is not a git repository.") @@ -181,6 +183,7 @@ def is_latest_version(repo_path: str): logger.error("An error occurred: %s", str(e)) raise + def load_sft_dataset( eval_file: str, max_seq_length: int, template_name: str, tokenizer: AutoTokenizer ) -> UnifiedSFTDataset: @@ -376,12 +379,14 @@ def loop(validation_args_file: str, task_id: str = None, auto_clean_cache: bool logger.info("Skip auto clean the model cache") repo_path = Path(__file__).resolve().parent.parent - + if not IS_DOCKER_CONTAINER: is_latest_version(repo_path) else: logger.info("Skip checking the latest version in docker container") - logger.info("Please make sure you are using the latest version of the docker image.") + logger.info( + "Please make sure you are using the latest version of the docker image." + ) fed_ledger = FedLedger(FLOCK_API_KEY) task_id_list = task_id.split(",") @@ -448,6 +453,7 @@ def loop(validation_args_file: str, task_id: str = None, auto_clean_cache: bool os.remove(eval_file) + cli.add_command(validate) cli.add_command(loop) diff --git a/src/validation_config.json.example b/src/validation_config.json.example index 6f0d0e3..2a7ce77 100644 --- a/src/validation_config.json.example +++ b/src/validation_config.json.example @@ -1,6 +1,6 @@ -{ +{ "per_device_eval_batch_size": 1, "fp16": true, "output_dir":".", "remove_unused_columns": false -} \ No newline at end of file +} diff --git a/src/validation_config_cpu.json.example b/src/validation_config_cpu.json.example index 40e3bda..14b25dc 100644 --- a/src/validation_config_cpu.json.example +++ b/src/validation_config_cpu.json.example @@ -1,7 +1,7 @@ -{ +{ "per_device_eval_batch_size": 1, "fp16": false, "output_dir":".", "remove_unused_columns": false, "use_cpu": true -} \ No newline at end of file +}