Spaces:
Build error
Build error
:pencil: [Comment] References of requests params
Browse files
networks/message_streamer.py
CHANGED
@@ -42,7 +42,11 @@ class MessageStreamer:
|
|
42 |
self.request_headers = {
|
43 |
"Content-Type": "application/json",
|
44 |
}
|
45 |
-
#
|
|
|
|
|
|
|
|
|
46 |
self.request_body = {
|
47 |
"inputs": prompt,
|
48 |
"parameters": {
|
@@ -70,7 +74,7 @@ class MessageStreamer:
|
|
70 |
|
71 |
if content.strip() == "</s>":
|
72 |
content_type = "Finished"
|
73 |
-
logger.
|
74 |
else:
|
75 |
content_type = "Completions"
|
76 |
logger.mesg(content, end="")
|
|
|
42 |
self.request_headers = {
|
43 |
"Content-Type": "application/json",
|
44 |
}
|
45 |
+
# References:
|
46 |
+
# huggingface_hub/inference/_client.py:
|
47 |
+
# class InferenceClient > def text_generation()
|
48 |
+
# huggingface_hub/inference/_text_generation.py:
|
49 |
+
# class TextGenerationRequest > param `stream`
|
50 |
self.request_body = {
|
51 |
"inputs": prompt,
|
52 |
"parameters": {
|
|
|
74 |
|
75 |
if content.strip() == "</s>":
|
76 |
content_type = "Finished"
|
77 |
+
logger.success("\n[Finished]")
|
78 |
else:
|
79 |
content_type = "Completions"
|
80 |
logger.mesg(content, end="")
|