Spaces:
Sleeping
Sleeping
aaaaa
Browse files
app.py
CHANGED
@@ -44,6 +44,10 @@ def respond(
|
|
44 |
do_sample=True,
|
45 |
top_p=top_p,
|
46 |
):
|
|
|
|
|
|
|
|
|
47 |
token = output['generated_text'][-1]['content']
|
48 |
response += token
|
49 |
yield history + [(message, response)] # Yield history + new response
|
@@ -66,6 +70,10 @@ def respond(
|
|
66 |
temperature=temperature,
|
67 |
top_p=top_p,
|
68 |
):
|
|
|
|
|
|
|
|
|
69 |
if stop_inference:
|
70 |
response = "Inference cancelled."
|
71 |
break
|
|
|
44 |
do_sample=True,
|
45 |
top_p=top_p,
|
46 |
):
|
47 |
+
if stop_inference:
|
48 |
+
response = "Inference cancelled."
|
49 |
+
yield history + [(message, response)]
|
50 |
+
return
|
51 |
token = output['generated_text'][-1]['content']
|
52 |
response += token
|
53 |
yield history + [(message, response)] # Yield history + new response
|
|
|
70 |
temperature=temperature,
|
71 |
top_p=top_p,
|
72 |
):
|
73 |
+
if stop_inference:
|
74 |
+
response = "Inference cancelled."
|
75 |
+
yield history + [(message, response)]
|
76 |
+
return
|
77 |
if stop_inference:
|
78 |
response = "Inference cancelled."
|
79 |
break
|