Skip to content

Commit

Permalink
💬 Fix chat for windows (#2443)
Browse files Browse the repository at this point in the history
* fix chat for windows

* add some tests back

* Revert "add some tests back"

This reverts commit 350aef5.
  • Loading branch information
qgallouedec authored Dec 10, 2024
1 parent 9410874 commit 2f72f47
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions examples/scripts/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import copy
import json
import os
import pwd
import platform
import re
import sys
import time
Expand All @@ -32,6 +32,10 @@
from trl.trainer.utils import get_quantization_config


if platform.system() != "Windows":
import pwd


init_zero_verbose()

HELP_STRING = """\
Expand Down Expand Up @@ -138,7 +142,10 @@ def print_help(self):


def get_username():
return pwd.getpwuid(os.getuid())[0]
if platform.system() == "Windows":
return os.getlogin()
else:
return pwd.getpwuid(os.getuid()).pw_name


def create_default_filename(model_name):
Expand Down

0 comments on commit 2f72f47

Please sign in to comment.