Skip to content

Commit 9dddd11

Browse files
authored
fix: move python header comments below shebang in some backends (#1321)
* Fix python header comments for some extra gRPC backends When a Python script is to be executed directly via exec(3), either the platform knows how to execute the file itself (i.e. special configuration is necessary) or the first line contains a shebang (#!) specifying the interpreter to run it (similar to shell scripts). The shebang MUST be on the first line for the script to work on all platforms, so any header comments need to be in the lines following it. Otherwise executing these scripts as extra backends will yield an "exec format error" message. Changes: * Move introductory comments below the shebang line * Change header comment in transformers.py to refer to the correct python module Signed-off-by: Marcus Köhler <[email protected]> * Make header comment in ttsbark.py more specific Signed-off-by: Marcus Köhler <[email protected]> --------- Signed-off-by: Marcus Köhler <[email protected]>
1 parent c5c77d2 commit 9dddd11

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

backend/python/bark/ttsbark.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1+
#!/usr/bin/env python3
12
"""
2-
This is the extra gRPC server of LocalAI
3+
This is an extra gRPC server of LocalAI for Bark TTS
34
"""
4-
5-
#!/usr/bin/env python3
65
from concurrent import futures
76
import time
87
import argparse

backend/python/sentencetransformers/sentencetransformers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
#!/usr/bin/env python3
12
"""
23
Extra gRPC server for HuggingFace SentenceTransformer models.
34
"""
4-
#!/usr/bin/env python3
55
from concurrent import futures
66

77
import argparse

backend/python/transformers/transformers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
#!/usr/bin/env python3
12
"""
2-
Extra gRPC server for HuggingFace SentenceTransformer models.
3+
Extra gRPC server for HuggingFace AutoModel models.
34
"""
4-
#!/usr/bin/env python3
55
from concurrent import futures
66

77
import argparse

0 commit comments

Comments
 (0)