We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent afcef9c commit d049adbCopy full SHA for d049adb
1 file changed
oneping/__main__.py
@@ -5,11 +5,17 @@
5
from .api import reply, stream, embed
6
from .server import start_llama_cpp, start_router
7
8
-def get_content(query, image=None):
9
- content = {}
10
- if query is None:
+def get_content(query=None, image=None):
+ # get query/image from stdin
+ if query is None or query == '-':
11
if not sys.stdin.isatty():
12
query = sys.stdin.read()
13
+ if image == '-':
14
+ if not sys.stdin.isatty():
15
+ image = sys.stdin.read()
16
+
17
+ # return content dict
18
+ content = {}
19
if query is not None:
20
content['query'] = query
21
if image is not None:
0 commit comments