Spaces:
Runtime error
Runtime error
Commit
·
2a78417
1
Parent(s):
d4772a6
dealing with empty outputs
Browse files
model.py
CHANGED
@@ -62,7 +62,7 @@ def run(message: str,
|
|
62 |
top_p: float = 0.95,
|
63 |
top_k: int = 50) -> Iterator[str]:
|
64 |
prompt = get_prompt(message, chat_history, system_prompt)
|
65 |
-
inputs = tokenizer([prompt], return_tensors='pt', add_special_tokens=False)
|
66 |
|
67 |
streamer = TextIteratorStreamer(tokenizer,
|
68 |
timeout=10.,
|
@@ -83,5 +83,6 @@ def run(message: str,
|
|
83 |
|
84 |
outputs = []
|
85 |
for text in streamer:
|
|
|
86 |
outputs.append(text)
|
87 |
yield ''.join(outputs)
|
|
|
62 |
top_p: float = 0.95,
|
63 |
top_k: int = 50) -> Iterator[str]:
|
64 |
prompt = get_prompt(message, chat_history, system_prompt)
|
65 |
+
inputs = tokenizer([prompt], return_tensors='pt', add_special_tokens=False) #.to(torch.device) #.to('cuda')
|
66 |
|
67 |
streamer = TextIteratorStreamer(tokenizer,
|
68 |
timeout=10.,
|
|
|
83 |
|
84 |
outputs = []
|
85 |
for text in streamer:
|
86 |
+
print(f"output text ->{text}<- end of text")
|
87 |
outputs.append(text)
|
88 |
yield ''.join(outputs)
|